English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Hi all,


I am Doing project in Java Swing. I need a help line for using scroll pane with table and textarea.


This I have done as coding It never works well.
final String[] colheads={"Book Name","Due Date"};
final Object[][] data={{"",""},{"",""},{"",""},{"",""},{"",""},{"",""}};
JTable table=new JTable(data,colheads);
JScrollPane jsp=new JScrollPane(table);//,ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
panel.add(jsp);
getContentPane().add(panel);

2007-02-17 18:27:32 · 2 answers · asked by Anonymous in Computers & Internet Programming & Design

2 answers

JTable and JTextArea inherit from java.awt.Container, so you can use their "add" method in order to add a JScrollPane. (e.g. table.add(jsp))

2007-02-17 19:11:32 · answer #1 · answered by Amit Y 5 · 0 0

because you position colspan="2" in the first td, the subsequent row must have 3 td aspects (or the first row must have in trouble-free terms a million). because it is, you are able to assume sizing complications. you'd be in a position to apply the CSS 'clip' sources, besides the undeniable fact that it calls for you understand width and top in improve. yet another plausible is the CSS 'overflow' sources which suppresses scroll bars on oversize content cloth. again, your td would must be sized in width and top for this to paintings. per chance like this: too many words626726e6bd1215f36719a308a25b798

2016-12-04 07:58:44 · answer #2 · answered by ? 4 · 0 0

fedest.com, questions and answers