Results 1 to 6 of 6
  1. #1
    prasad.vara is offline Member
    Join Date
    Jul 2010
    Location
    Hyderabad
    Posts
    21
    Rep Power
    0

    Default How to avoid the gap between two more panels in netbeans IDE

    I am developing example desktop application using Netbeans IDE.In that ,i took one JFrame and I added one mainpanel to that JFrame. then i added three panels into the mainpanel.But I got a problem ,i.e when i was adding the three panels to mainpanel ,these three panels are not merging .I shows some gap between the panels. I was unable to solve this. please anybody help me.
    Last edited by prasad.vara; 07-26-2010 at 03:39 PM.

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,560
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by prasad.vara View Post
    I am developing example desktop application using Netbeans IDE.In that ,i took one JFrame and I added one mainpanel to that JFrame. then i added three panels into the mainpanel.But I got a problem ,i.e when i was adding the three panels to mainpanel ,these three panels are not merging .I shows some gap between the panels. I was unable to solve this. please anybody help me.
    You should be able to specify the size of the gap(s) in the LayoutManager in the content pane of your JFrame.

    kind regards,

    Jos

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,298
    Rep Power
    20

    Default

    My advice on your earlier thread still applies.
    how to impliment minimize button in swing

    db

  4. #4
    Prajin's Avatar
    Prajin is offline Senior Member
    Join Date
    Jun 2010
    Location
    Ktm, Nepal
    Posts
    120
    Rep Power
    0

    Default

    If you are using Netbean as IDE then remember this, that Netbean by default use GroupLayout. When you add components to panel, IDE add gaps. You can't change it so easily or better to say IDE won't allow this.

    To overcome your problem, Right-click on your JFrame in IDE,
    goto 'Set Layout' then choose any layout. If you really want panels border to touch each other or overlap then use absolute layout. But doing so you might face other problems, remember that.

  5. #5
    prasad.vara is offline Member
    Join Date
    Jul 2010
    Location
    Hyderabad
    Posts
    21
    Rep Power
    0

    Default

    thanks a lot prajin

  6. #6
    Prajin's Avatar
    Prajin is offline Senior Member
    Join Date
    Jun 2010
    Location
    Ktm, Nepal
    Posts
    120
    Rep Power
    0

    Default

    If your using Absolute Layout, it may have solved your problem. But when you maximized the JFrame then all components stays where they are. That's not good look.
    Try to go with Group Layout or other Layouts.
    -Regards

Similar Threads

  1. How to avoid the Deadlock in the below program
    By murali1253 in forum New To Java
    Replies: 3
    Last Post: 04-16-2010, 05:46 PM
  2. How to avoid this problem...
    By pbaudru in forum AWT / Swing
    Replies: 6
    Last Post: 01-21-2010, 01:20 PM
  3. How to avoid focus()..?
    By ehochedez in forum NetBeans
    Replies: 9
    Last Post: 08-27-2009, 11:32 AM
  4. Avoid using systems DPI settings ?
    By rolfius in forum AWT / Swing
    Replies: 5
    Last Post: 08-03-2009, 03:12 AM
  5. how to avoid input errors?
    By Sinnergy in forum New To Java
    Replies: 5
    Last Post: 02-02-2009, 11:25 PM

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
  •