The Artima Developer Community
Sponsored Link

Java Answers Forum
need help for table stuff

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Mike Lee

Posts: 3
Nickname: mike2004
Registered: May, 2004

need help for table stuff Posted: May 13, 2004 1:05 AM
Reply to this message Reply
Advertisement
Sorry I post again.Thank you very much for neumi's reply.I would like to ask more questions(Sorry, I am new to java).

Actually, my case is :
I've got a class :

class AllComponents extends Frame{
//this class creates all components in a frame: buttons, textarea , etc.
...

lower_panel.add(text_area, "Center");
//This statement is for creating a textarea with some text.If I comment out this statement, the textarea will disappear.
...



}


I've got another class which creates a table:

class SimpleTable extends JFrame
{
public SimpleTable()
{
table = new JTable(dataValues,columnNames);
...

}


public static void main(string args())
{
SimpleTable thisFrame = new SimpleTable();
thisFrame.setVisible(ture);
}

}

When I run SimpleTable as a standalone one,it produces a table for me. Now I want to add this table to the class AllComponents to replace that textarea, so when I run AllComponents, I will see a talbe instead of that textarea.

so my questions are: How can I insert the class SimpleTable to class ALLComponents?(I Know I need to get rid of main().)
Does it matter that SimpleTable extends JFrame but AllComponents extends Frame?
Can I comment out lower_panel.add(text_area, "Center"), add a new statement lower_panel.add(mytable, "Center")?

Will appreciate anyone's help.

Mike

Topic: Searching OBT's Previous Topic   Next Topic Topic: Email,Applets and Result

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use