Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Panels and seperate classes

Status
Not open for further replies.

mphayesuk

IS-IT--Management
Apr 22, 2003
46
GB
I have a main class that will create a tabbed interface. each tab will call a class that has been imported from a seperate file, the trouble is with the imported class it will create some text boxes and labels to put on the screen.

Using a JPanel as the base with border layout and a details panel which will hold the text boxes. add details with null layout to main panel and then disply it with this.add(....). this does not work and does not display anything, I can get it to display all the textboxes in one long line but not as set out in setbounds.

Is there anyway to transport the panel back to the main class to display.

ie. import class

public class Import extends JPanel{

public Import(){
qpanel();
}

protected Component qpanel(){
set text boxes up
return qpanel
}
}

main class has this statement
Component panel1 = new QuoteSystem()

and...

tabbedPane.addTab("Quotes", icon, panel1, "");


Can anyone help... a more detailed class files can be put on if needed or any other questions I will try and answer.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top