File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes its a Pane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "its a Pane" Watch "its a Pane" New topic
Author

its a Pane

Martin webster
Greenhorn

Joined: Jun 20, 2001
Posts: 20
Does anyone know the difference between a Pane and a Panel. I have noticed that throughout swing, there are many types of pane.... eg JScrollPane, JTabbedPane, JOptionPane etc. Does anyone know why they are called Pane and not Panel?
If Pane represents some sort of behaviour then shouldn't there be a Pane interface ?
The reason I want to know this, is that I am creating some components that extend JPanel, and don't know whether to use a Pane or a Panel suffix.


Martin
David Eason
Greenhorn

Joined: Oct 31, 2001
Posts: 14
I am creating some components that extend JPanel, and don't know whether to use a Pane or a Panel suffix.

First, I don't think it matters a whole lot.
Secondly, I would note that Panel begets Applet and that JPanel begets AbstractColorChooserPanel, and I would use either of those as your precedents. In other words, use a more descriptive name (like Applet) or a class name ending in Panel. I can't find any example in the API of a Pane object begotten from the Panel or JPanel classes; however, you might if your class acts more like one of the classes ended in Pane, for example if you are deriving from Panel but your class will ultimately be a fancier form of ScrollPane.

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: its a Pane