Link to home
Start Free TrialLog in
Avatar of snajalm
snajalm

asked on

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!  
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

I think we've covered this elsewhere. You're not using standard layout managers are you?
Avatar of snajalm
snajalm

ASKER

I'm using the "Free Layout" under the "Set Layout" in Netbeans.
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.
Avatar of snajalm

ASKER

Its funny but a "Clean Build" in Netbeans made everything right!  Would you know why??!
ASKER CERTIFIED SOLUTION
Avatar of for_yan
for_yan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>>Would you know why??!

You were running code that was compiled prior to corrections having been made
Avatar of snajalm

ASKER

But what's the difference between "Run" and "Clean Build"???!  Aren't they both compiling??!
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.
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
Avatar of snajalm

ASKER

Thanks heaps!