Results 1 to 3 of 3
- 09-27-2009, 02:05 AM #1
Member
- Join Date
- Mar 2009
- Posts
- 38
- Rep Power
- 0
How to set the size of Drawing pane
Hi, I have problem to get the right size dimension of my drawing panel.
I set the dimension size of 400,400. However, it seems that the drawing panel is larger than 400,400.
How can I make the drawing panel exactly the same size by 400,400.
Java Code:public class DrawingBoardWithMatrix extends JFrame { public static void main(String[] args) { new DrawingBoardWithMatrix(); } public DrawingBoardWithMatrix(){ Container c = getContentPane(); c.add(new PaintSurface(), BorderLayout.CENTER); c.setPreferredSize(new Dimension (400,400)); pack(); this.setVisible(true); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setResizable(false); }Last edited by cassysumandak; 09-27-2009 at 02:12 AM.
-
What if you call setResizable(false) before calling pack?
- 09-27-2009, 03:13 AM #3
Member
- Join Date
- Mar 2009
- Posts
- 38
- Rep Power
- 0
Similar Threads
-
tabbed Pane .
By programmer_007 in forum AWT / SwingReplies: 2Last Post: 09-03-2009, 08:52 PM -
Setting frame size to the size of an image
By Yoruichi in forum AWT / SwingReplies: 5Last Post: 04-22-2009, 04:37 PM -
Tabbed pane using struts 2.x......?
By prabhurangan in forum Web FrameworksReplies: 1Last Post: 07-19-2008, 06:48 AM -
Layered Pane Demo
By Java Tip in forum javax.swingReplies: 0Last Post: 06-26-2008, 07:44 PM -
call exe in Desktop Pane
By smartsubroto in forum New To JavaReplies: 4Last Post: 06-16-2008, 07:49 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks