|
-
Nov 19th, 2001, 11:14 AM
#1
Thread Starter
Hyperactive Member
SWING: whats the difference between panels and panes? [resolved]
What is the difference between a panel and a pane? They are both used often, but why is it JTabbedPane and JPanel and not the other wayaround? Any reason?...
Why do you sometimes use .add (eg. JPanel) and sometimes .getContentPane().add (eg. JInternalDialog)?
Is there and way to, by code, maximize a JFrame or JInternalFrame?
Last edited by CaptainPinko; Jan 10th, 2002 at 04:38 PM.
"There are only two things that are infinite. The universe and human stupidity... and the universe I'm not sure about." - Einstein
If you are programming in Java use www.NetBeans.org
-
Nov 19th, 2001, 06:04 PM
#2
Dazed Member
What is the difference between a panel and a pane? They are both used often, but why is it JTabbedPane and JPanel and not the other wayaround? Any reason?...
JTabbedPane is an actual component. JPanel is a component also but it really offers no additional functionality other then to group components.
Why do you sometimes use .add (eg. JPanel) and sometimes .getContentPane().add (eg. JInternalDialog)?
I used to be confused with this also. And i would often forget to add components to the content pane instead of say a JFrame which causes a compilation error.
.getContentPane().add (eg. JInternalDialog) that you are refering to is a short hand alternative. You can code it like this if you wanted to(as i often do)
Code:
JFrame jf = new JFrame("Hello");
Container c = jf.getContentPane();
c.add(jc);
Last edited by Dilenger4; Nov 19th, 2001 at 06:08 PM.
-
Jan 8th, 2002, 04:58 AM
#3
a panel (be it awt or swing) is a container, as was said before. a pane is part of the view port (sort of like the z axis/order). go to http://java.sun.com/docs/books/tutorial/search.html and type in pane - it should bring up quite a bit about panes
-
Jan 8th, 2002, 10:24 AM
#4
Dazed Member
I thought we resolved this issue.
-
Jan 8th, 2002, 02:24 PM
#5
mainly just put it there for any other newbie who may be a tad confused bout it, sowy 
must admit, it is a bit hard to grasp the concept of java at times (especially if one has programmed in another language e.g vb - went through that hell myself: cobol, basic, vb, pascal)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|