|
import java.util.Arrays; |
|
import java.util.Enumeration; |
|
|
|
import javax.swing.JFrame; |
|
import javax.swing.JScrollPane; |
|
import javax.swing.JTable; |
|
import javax.swing.UIDefaults; |
|
import javax.swing.UIManager; |
|
import javax.swing.WindowConstants; |
|
|
|
public class test_ListSwingtags |
|
{ |
|
public static void main(String[] args) |
|
{ |
|
System.setProperty("sun.java2d.opengl", "true"); |
|
UIDefaults defaults = UIManager.getDefaults(); |
|
String[] colName = { "Key", "Type", "Value" }; |
|
String[] tempRowName = new String[defaults.size()]; |
|
int i = 0; |
|
for (Enumeration< ? > e = defaults.keys(); e.hasMoreElements(); i++) |
|
{ |
|
Object key = e.nextElement(); |
|
tempRowName[i] = key.toString(); |
|
} |
|
|
|
Arrays.sort(tempRowName); |
|
String[][] rowData = new String[tempRowName.length][3]; |
|
for (int j = 0; j < tempRowName.length; j++) |
|
{ |
|
rowData[j][0] = tempRowName[j]; |
|
rowData[j][1] = "" + (defaults.get(tempRowName[j]) == null ? defaults.get(tempRowName[j]) |
|
: defaults.get(tempRowName[j]).getClass().getSimpleName()); |
|
rowData[j][2] = "" + defaults.get(tempRowName[j]); |
|
} |
|
JFrame f = new JFrame("UIManager properties default values"); |
|
JTable t = new JTable(rowData, colName); |
|
f.setContentPane(new JScrollPane(t)); |
|
f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); |
|
f.pack(); |
|
f.setVisible(true); |
|
} |
|
|
|
} |