Re: 1 JFrame, more JPanels
Can you post the full code?
java exception
Re: 1 JFrame, more JPanels
Quote:
Originally Posted by
jknwhz
JPanel Display = new Panel();
Display.setBounds(12,12,288,208)
gives:
line xxx: <identifier> expected
Display.setBounds(12,12,288,208)
^
WHAT IS WRONG HERE?
??????
>>>>>>>>>>>>
I am thinking you need a Dimension there for you need setMinuminSize(new Dimension(width, height)) ; //semi colon...
setMaximumSize(new Dimension(width,height);
setPreferedSize(new Dimension(width,height);
your looking a JPanel this may help what is going on... setBounds
Just a helper with building gui's use the gui builder in netbeans or a gui builder in your platform. Then use the properties to help you out.
I use gui's all the time but I dont have a platform on this computer.
Re: 1 JFrame, more JPanels
Quote:
Originally Posted by william
Just a helper with building gui's use the gui builder in netbeans or a gui builder in your platform
For what its worth, in my opinion Gui builder's are not for novices. More often than not cause many more problems than they are worth, as they skip over the fine grain details and when a problem arises, fixing said problem becomes extremely difficult due to the lack of knowledge of the underlying details. In other words, a gui builder will not fix the underlying problem of the original post.
To the original poster: use an appropriate layout manager (see A Visual Guide to Layout Managers (The Java™ Tutorials > Creating a GUI With JFC/Swing > Laying Out Components Within a Container) ) and become familiar with the API of the classes you use - deprecated methods should be avoided. If you wish to set sizes of a Component, use the appropriate method (setPreferredSize, setMinimumSize, setMaximumSize). In most cases, the appropriate layout manager and call to the appropriate method mentioned should be enough. If not, post an SSCCE of the problem