관리 메뉴

moozi

이미지버튼 본문

TIS_2018/응용sw2018_2기

이미지버튼

moozi 2018. 8. 20. 11:35

import java.awt.Container;
import java.awt.FlowLayout;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;

public class ButtonEx extends JFrame{
 public ButtonEx() {
  this.setTitle("이미지버튼");
  this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  Container c=this.getContentPane();
  c.setLayout(new FlowLayout());
  
  ImageIcon normalIcon=new ImageIcon("images/normalIcon.png");
  JButton btn=new JButton("Call",normalIcon);
  c.add(btn);
  
  this.setSize(250,250);
  this.setVisible(true);
 }
 public static void main(String[] args) {
  new ButtonEx();

 }

}

'TIS_2018 > 응용sw2018_2기' 카테고리의 다른 글

Gallery02  (0) 2018.08.21
자바연습문제13  (0) 2018.08.20
이벤트처리  (0) 2018.08.20
자바연습문제12  (0) 2018.08.17
자바연습문제11  (0) 2018.08.16
Comments