• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 409
  • Last Modified:

JDialog and JPanel do not open to their set sizes and do not show their labels!

In my Netbeans code I have JPanels and JDialog which are driving me crazy at times.  Some of the controllers on these containers decide not to show up or automatically change size even though I have set up both their size and contents within the code and through using the IDE properties.  For instance some of my jButtons on a certain JPanel does not show its text label or the sizes of some of my text field change.

Any solution to this would be grately appreciated!  
0
snajalm
Asked:
snajalm
  • 4
  • 3
  • 3
1 Solution
 
CEHJCommented:
I think we've covered this elsewhere. You're not using standard layout managers are you?
0
 
snajalmAuthor Commented:
I'm using the "Free Layout" under the "Set Layout" in Netbeans.
0
 
for_yanCommented:
Better not to use FreeLayout and don't specify sizes to individual components.
In most cases it is much more convenient to use FlowLayout, BorderLayout and GridLayout
to let them place your components and manage their sizes.
It in fact it takes only a little bit of effort to learn them and you'll be independent of NetBeans
or anything and rely only on Java itself.
Post your code or approximate picture of how you want your components to be arranged and we'll figure out the best way to do it.
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
snajalmAuthor Commented:
Its funny but a "Clean Build" in Netbeans made everything right!  Would you know why??!
0
 
for_yanCommented:
Strange.
Maybe it recompiled some of the java files, which it was not recompiling for some reason before.

Clean Build makes unconditional re-compilation of all files, whereas
otherwise NetBeans makes various checks (if file was changed after previous compilation)
In geeral it should be the same.
But sometimes there are some tricks with dates, which can affect the situation.
0
 
CEHJCommented:
>>Would you know why??!

You were running code that was compiled prior to corrections having been made
0
 
snajalmAuthor Commented:
But what's the difference between "Run" and "Clean Build"???!  Aren't they both compiling??!
0
 
for_yanCommented:
See my explanation above - they should be bothe compiling, but Run checks the dates of changed files and compiles only chnaged files.
There may be some glitch when some importnat file will be left uncompiled.
Clean Build compiles all files unconditionally.
0
 
CEHJCommented:
I'd have to see the build files to say, but run possibly only compiles those source files that *need* compiling. A clean build deletes all class files and recompiles
0
 
snajalmAuthor Commented:
Thanks heaps!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now