2022-03-11 14:20:22 +01:00
|
|
|
package love.distributedrebirth.unicode4d;
|
|
|
|
|
|
|
|
|
|
import java.awt.Dimension;
|
|
|
|
|
import java.awt.GridLayout;
|
|
|
|
|
|
|
|
|
|
import javax.swing.JFrame;
|
|
|
|
|
import javax.swing.JPanel;
|
|
|
|
|
import javax.swing.JScrollPane;
|
|
|
|
|
import javax.swing.JTable;
|
|
|
|
|
import javax.swing.SwingUtilities;
|
|
|
|
|
|
2022-10-10 18:04:27 +02:00
|
|
|
import love.distributedrebirth.numberxd.unicode.UnicodePlane;
|
2022-11-05 13:41:48 +01:00
|
|
|
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
|
2022-08-24 17:33:39 +02:00
|
|
|
|
2022-10-30 16:59:24 +01:00
|
|
|
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
2022-03-11 14:20:22 +01:00
|
|
|
public class TestSwingPlane extends JPanel {
|
|
|
|
|
|
|
|
|
|
private static final long serialVersionUID = 4146160826151405548L;
|
|
|
|
|
|
|
|
|
|
public TestSwingPlane() {
|
|
|
|
|
super(new GridLayout(1, 0));
|
|
|
|
|
|
|
|
|
|
String[] columnNames = { "Plane", "Example"};
|
|
|
|
|
|
2022-10-10 18:04:27 +02:00
|
|
|
Object[][] data = new Object[UnicodePlane.values().length][2];
|
2022-03-11 14:20:22 +01:00
|
|
|
|
|
|
|
|
int x=0;
|
2022-10-10 18:04:27 +02:00
|
|
|
for (UnicodePlane plane:UnicodePlane.values()) {
|
2022-03-11 14:20:22 +01:00
|
|
|
data[x][0] = plane.name();
|
|
|
|
|
StringBuilder buf = new StringBuilder();
|
|
|
|
|
int offset = 33;
|
|
|
|
|
for (int i=plane.getStart()+offset;i<plane.getStart()+33+offset;i++) {
|
|
|
|
|
buf.append((char)i);
|
|
|
|
|
buf.append(" ");
|
|
|
|
|
}
|
|
|
|
|
data[x][1] = buf.toString();
|
|
|
|
|
x++;
|
|
|
|
|
}
|
|
|
|
|
final JTable table = new JTable(data, columnNames);
|
|
|
|
|
table.setPreferredScrollableViewportSize(new Dimension(500, 70));
|
|
|
|
|
table.setFillsViewportHeight(true);
|
|
|
|
|
JScrollPane scrollPane = new JScrollPane(table);
|
|
|
|
|
add(scrollPane);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static public void main(String[] args) {
|
|
|
|
|
SwingUtilities.invokeLater(new Runnable() {
|
|
|
|
|
public void run() {
|
|
|
|
|
createAndShowGUI();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void createAndShowGUI() {
|
|
|
|
|
JFrame frame = new JFrame("SimpleTableDemo");
|
|
|
|
|
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
|
|
|
|
|
|
|
|
TestSwingPlane newContentPane = new TestSwingPlane();
|
|
|
|
|
newContentPane.setOpaque(true); // content panes must be opaque
|
|
|
|
|
frame.setContentPane(newContentPane);
|
|
|
|
|
frame.pack();
|
|
|
|
|
frame.setVisible(true);
|
|
|
|
|
}
|
|
|
|
|
}
|