Results 1 to 3 of 3
  1. #1
    cassysumandak is offline Member
    Join Date
    Mar 2009
    Posts
    38
    Rep Power
    0

    Default 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 03:12 AM.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

  3. #3
    cassysumandak is offline Member
    Join Date
    Mar 2009
    Posts
    38
    Rep Power
    0

Similar Threads

  1. tabbed Pane .
    By programmer_007 in forum AWT / Swing
    Replies: 2
    Last Post: 09-03-2009, 09:52 PM
  2. Setting frame size to the size of an image
    By Yoruichi in forum AWT / Swing
    Replies: 5
    Last Post: 04-22-2009, 05:37 PM
  3. Tabbed pane using struts 2.x......?
    By prabhurangan in forum Web Frameworks
    Replies: 1
    Last Post: 07-19-2008, 07:48 AM
  4. Layered Pane Demo
    By Java Tip in forum javax.swing
    Replies: 0
    Last Post: 06-26-2008, 08:44 PM
  5. call exe in Desktop Pane
    By smartsubroto in forum New To Java
    Replies: 4
    Last Post: 06-16-2008, 08:49 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •