Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror

Comment erm... Swing has table elements like that (Score 1) 216

Sun has given that response because it is correct. If they hadn't listened to what people wanted, we'd still be using AWT.

You can use most, if not all, controls in JTables. For example: you could use text fields, buttons, or combo boxes as table cells. You can also extend AbstractTableModel to create a custom table model, a very useful feature.

Creating a JTable like the one you described is quite easy.


Jtable table = new JTable(
new String[][]
{
{"one","two","three","four","five","six"},
{"1","2","3","4","5","6"},
},
new String[] {"Col1", "Col2", "Col3","Col4","Col5","Col5"}
);

Then just add it to the applet or application. You would need to make a custom table model to be able to acctually edit the fields, but those are pretty basic.

Slashdot Top Deals

Doubt is not a pleasant condition, but certainty is absurd. - Voltaire

Working...