?
Solved

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

Posted on 2011-10-16
10
Medium Priority
?
404 Views
Last Modified: 2012-08-14
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
Comment
Question by:snajalm
  • 4
  • 3
  • 3
10 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 36975830
I think we've covered this elsewhere. You're not using standard layout managers are you?
0
 

Author Comment

by:snajalm
ID: 36975832
I'm using the "Free Layout" under the "Set Layout" in Netbeans.
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36976006
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:snajalm
ID: 36976148
Its funny but a "Clean Build" in Netbeans made everything right!  Would you know why??!
0
 
LVL 47

Accepted Solution

by:
for_yan earned 2000 total points
ID: 36976178
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
 
LVL 86

Expert Comment

by:CEHJ
ID: 36976179
>>Would you know why??!

You were running code that was compiled prior to corrections having been made
0
 

Author Comment

by:snajalm
ID: 36976192
But what's the difference between "Run" and "Clean Build"???!  Aren't they both compiling??!
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36976194
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
 
LVL 86

Expert Comment

by:CEHJ
ID: 36976196
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
 

Author Closing Comment

by:snajalm
ID: 36978989
Thanks heaps!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses
Course of the Month16 days, 5 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question