1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
|
/VS4E -- DO NOT REMOVE THIS LINE!
public class uiFrame extends JFrame {
private static final long serialVersionUID = 1L;
private JButton jButton0;
private JTextArea jTextArea0;
private JScrollPane jScrollPane0;
private static final String PREFERRED_LOOK_AND_FEEL = "javax.swing.plaf.metal.MetalLookAndFeel";
public uiFrame() {
initComponents();
}
private void initComponents() {
setLayout(new GroupLayout());
add(getJButton0(), new Constraints(new Leading(105, 10, 10), new Leading(12, 12, 12)));
add(this.getJScrollPane0(), new Constraints(new Leading(14, 308, 12, 12), new Leading(44, 289, 10, 10)));
setSize(334, 341);
}
private JScrollPane getJScrollPane0() {
if (jScrollPane0 == null) {
jScrollPane0 = new JScrollPane();
jScrollPane0.setViewportView(getJTextArea0());
}
return jScrollPane0;
}
private JTextArea getJTextArea0() {
if (jTextArea0 == null) {
jTextArea0 = new JTextArea();
jTextArea0.setText("--");
}
return jTextArea0;
}
public void changeContentTextArea(String s){
System.out.println(s);
String actualText = jTextArea0.getText();
this.jTextArea0.append(s);
return;
}
private JButton getJButton0() {
if (jButton0 == null) {
jButton0 = new JButton();
jButton0.setText("Start Update");
jButton0.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent event) {
jButton0MouseMouseClicked(event);
}
});
}
return jButton0;
}
private static void installLnF() {
try {
String lnfClassname = PREFERRED_LOOK_AND_FEEL;
if (lnfClassname == null)
lnfClassname = UIManager.getCrossPlatformLookAndFeelClassName();
UIManager.setLookAndFeel(lnfClassname);
} catch (Exception e) {
System.err.println("Cannot install " + PREFERRED_LOOK_AND_FEEL
+ " on this platform:" + e.getMessage());
}
}
/**
* Main entry of the class.
* Note: This class is only created so that you can easily preview the result at runtime.
* It is not expected to be managed by the designer.
* You can modify it as you like.
*/
public static void main(String[] args) {
installLnF();
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
uiFrame frame = new uiFrame();
frame.setDefaultCloseOperation(uiFrame.EXIT_ON_CLOSE);
frame.setTitle("uiFrame");
frame.getContentPane().setPreferredSize(frame.getSize());
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
});
}
private void jButton0MouseMouseClicked(MouseEvent event) {
changeContentTextArea(" New Value");
jTextArea0.append(" Another New value");
}
} |
Partager