제발 자바상에서 버튼 크기 좀 조절어떻게 하는지좀 가르쳐주세
import javax.swing.JFrame;
import javax.swing.JButton;
import java.awt.Font;
/*
* Created on 2004. 11. 16
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
/**
* @author root
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class javaones extends JFrame {
public static void main(String args[]) {
javaones frame = new javaones();
frame.setBounds(100, 100, 500, 375);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
public javaones() {
super();
getContentPane().setFont(new Font("Baekmuk Headline", Font.PLAIN, 12));
final JButton button = new JButton();
//getContentPane().add(button, BorderLayout.WEST);
button.setSize(125,125);
button.setText("야후");
button.setLocation(120,120);
add(button);
//
}
}
소스는 이거인데요...버튼 위치하고 크기 조절하는 거 어떻게 하나요....?
제발 가르쳐주세요..ㅠ0ㅠ;;
코드를 좀더 보기 좋게 해보죠..[code:1]public c
코드를 좀더 보기 좋게 해보죠..
이렇게 하시면 됩니다. 그런데 BorderLayout은 사용자가 지정한 크기로 나타나지 않습니다.
Flow 나 Box 같은거 쓰시면 원하는 크기로 나타날 겁니다.
Gentoo. Bioinformatics, Protein Interaction.
댓글 달기