import javax.swing.*;
import java.awt.*;
public class TEST {
public static void main(String[] args) {
new Window();
}
static class Window extends JFrame {
Window() {
setSize(300, 250);
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
setLayout(new FlowLayout());
ImageIcon icon = new ImageIcon("icon.jpg");
setIconImage(icon.getImage());
getContentPane().add(new JLabel(icon));
setLocationRelativeTo(null);
setVisible(true);
}
}
}
์ฐฝ์ ์ด๋ฏธ์ง๊ฐ ํ์๋์ง ์๋ ์ด์ , ์ฐฝ ์์ด์ฝ์ด ๋ฐฐ์น๋์ง ์๋ ์ด์ ๋ฑ์ ์ฝ๋๊ฐ ์์ต๋๋ค. icon.jpg์ ํฌ๊ธฐ๋ 32x32ํฝ์
์ด๊ณ ๋๋จธ์ง ํ์ผ๊ณผ ํจ๊ป src์ ์์ต๋๋ค(์ ๋ intellij ์์ด๋์ด๋ฅผ ์ฌ์ฉํฉ๋๋ค). ์ฝ๋ ์คํ ๊ฒฐ๊ณผ๋ ํ์ค ์์ด์ฝ์ด ์๋ ๋น ์ฐฝ์
๋๋ค.
DenisJNewb
๋ ๋ฒจ 11
GO TO FULL VERSION