static void createAndShowGUI(Test test) {
try {
UIManager.setLookAndFeel(new MetalLookAndFeel());
} catch (Exception e) {
throw new RuntimeException(e);
}
frame = new JFrame();
frame.setSize(300, 300);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel panel = new JPanel(new FlowLayout());
String text = "AAAAAAA";
textField = test.isPasswordField()
? new JPasswordField(text)
: new JTextField(text);
textField.setUI(new MetalTextFieldUI() {
@Override
public View create(Element elem) {
return test.createView(elem);
}
});
panel.add(textField);
frame.getContentPane().add(panel);
frame.setVisible(true);
}
static void createAndShowGUI(Test test) {
try {
UIManager.setLookAndFeel(new MetalLookAndFeel());
} catch (Exception e) {
throw new RuntimeException(e);
}
frame = new JFrame();
frame.setSize(300, 300);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel panel = new JPanel(new FlowLayout());
String text = "AAAAAAA";
textField = test.isPasswordField()
? new JPasswordField(text)
: new JTextField(text);
textField.setUI(new MetalTextFieldUI() {
@Override
public View create(Element elem) {
return test.createView(elem);
}
});
panel.add(textField);
frame.getContentPane().add(panel);
frame.setVisible(true);
}