This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Basic questions in Swing  RSS feed

 
amit sanghai
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi everybody,

Q1) What is the base class for all Swing components?

Q2) What is JFC? What are the packages in it?
Q3) What is the corresponding layout for Card in Swing?
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A1) The base class of any Java object is:
java.lang.Object
Assuming that you know this and what you really want to know is where does Swing fit into the hierarchy:
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
...
A2) JFC - Java Foundation Classes. You are soaking in it ...
java.awt.* and javax.swing.*
Including all supporting packages (i.e.,
java.awt.event.*,javax.swing.table.*)
A3) The corresponding layout for Card in Swing is Card! Swing
makes use of all the AWT layouts and adds one more: Box.
Layouts work exactly the same for AWT and Swing:
Component.setLayout(new CardLayout());
 
amit sanghai
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thanks Manfred-- a lot!!! I am a novice in this area. Your answers really helped to clear my doubts.
 
ravi nimmala
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you help me how to run swing in browser?what version of ie i should have? do i need plugin?what about tags in html file?please help.
regards,
ravi
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will need to have the Java Plug-in to run an applet based on swing. In your HTML you should use the <OBJECT> tag. Details can be found here.
[This message has been edited by Bodie Minster (edited January 16, 2001).]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!