Hello guys..
i need a help.. m new in java swings.. m using netbeans to create one application..
here i have to insert a new jtable at runtime.. like when a click on a button jtable should be inserted.. how can i do that in netbeans.? please help..
raashi.rai
0
Newbie Poster
Recommended Answers
Jump to Post//Table declaration somewhere in the text JTable myTable = null; showTableBtn.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent ae){ //use any of the 7 constructors myTable = JTable(Object[][] rowData, Object[] columnNames); SOME_OBJECT.add(myTable); } });
SOME_OBJECT can be JPanel or any other subclass of Container.
All 3 Replies
peter_budo
2,532
Code tags enforcer
Team Colleague
Featured Poster
raashi.rai
0
Newbie Poster
peter_budo
2,532
Code tags enforcer
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.