Created
October 14, 2011 20:12
-
-
Save Tanner/1288184 to your computer and use it in GitHub Desktop.
JPanel with preferred size
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.awt.*; | |
| import javax.swing.*; | |
| public class Test extends JPanel { | |
| public Test() { | |
| setPreferredSize(new Dimension(400, 400)); | |
| } | |
| public static void main(String[] args) { | |
| JFrame frame = new JFrame(); | |
| frame.add(new Test()); | |
| frame.pack(); | |
| frame.setVisible(true); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment