• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to update container

 
Arun Bhowmick
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey,
i'm stuck with the following........
for my applet i put the drawing canvas in the center part of the the container. in the east i put another panel. during the applet init i put three jLabel component. after several activity i need to put a JTable in the same container. after feeding the data in the table when i try to put the table in this it doesn't show any update.
for ur better understanding i'm giving a tiny code
main applet class:
public class ShortestPath extends Applet {
// creating class instance
MenuOptions options = new MenuOptions(this);
AlgDescription stp_documentation = new AlgDescription(this);
NetworkCanvas netcanvas = new NetworkCanvas(this);
UserDoc documentation = new UserDoc();
// init method
public void init(){
setLayout(new BorderLayout(5,5));
add("Center",netcanvas);
add("North",documentation);
add("East",stp_documentation);
add("South",options);
this.stp_documentation.add("North",new JLabel());
JLabel lbl = new JLabel("DESCRIPTIOIN TABLE");
lbl.setFont(this.stp_documentation.arial);
this.stp_documentation.add("Center",lbl);
this.stp_documentation.add("South",new JLabel());
}
}
the class where i'm updating the Jtable:
class AlgDescription extends JPanel{
public void add_table(){
System.out.println("sfsfsf");
JTable link_table = new JTable(data_link,link_colnames);
link_model.setNumRows(linknum);
link_model.setColumnCount(2);
link_table.setModel(link_model);
Dimension tree_viewportSize = new Dimension(300,300);
Dimension link_viewportSize = new Dimension(300,300);
System.out.println("viewport"+link_viewportSize);
link_table.setPreferredScrollableViewportSize(link_viewportSize);
JScrollPane link_pane = new JScrollPane(link_table,JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
this.add("Center",link_pane);

}
}
pls help
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!