Results 1 to 4 of 4
  1. #1
    hitmen is offline Member
    Join Date
    Oct 2008
    Posts
    58
    Rep Power
    0

    Default Setting JPanel to a fullscreen

    I currently have 2 JLabels in a JPanel. One contains an image while the other has a GIF.

    I need to resize the JPanel to fit fullscreen. Do you have the code for it? I know how to resize an image but not the JPanel. How?

  2. #2
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    12

    Default

    setBounds()

  3. #3
    hitmen is offline Member
    Join Date
    Oct 2008
    Posts
    58
    Rep Power
    0

    Default

    Any sample code?

  4. #4
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    12

    Default

    If your panel is called 'panel, the following will move it to the top left corner of your screen and size it at 300x300 pixels.

    Java Code:
    panel.setBounds(0,0,300,300);
    I strongly recommend you peruse the javadoc API for JPanel.

Similar Threads

  1. Problems with setting the menubar and a JPanel visible
    By leitbug06 in forum AWT / Swing
    Replies: 1
    Last Post: 03-06-2009, 11:46 PM
  2. Setting the DSN
    By tim in forum JDBC
    Replies: 1
    Last Post: 02-14-2008, 09:55 PM
  3. Help with setting up Java
    By itmasterw in forum New To Java
    Replies: 6
    Last Post: 01-18-2008, 11:04 PM
  4. Help with setting up please
    By BlitzA in forum New To Java
    Replies: 6
    Last Post: 12-29-2007, 12:54 PM

Posting Permissions

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