]>
git.argeo.org Git - gpl/argeo-slc.git/blob - sandbox/argeo.slc.jemmytest/src/main/java/org/argeo/slc/autoui/swingtest/SwingTestUi.java
8333e1c8bbff0952926e7be9c3b89c24dc828360
1 package org
.argeo
.slc
.autoui
.swingtest
;
3 import java
.awt
.event
.ActionEvent
;
4 import java
.awt
.event
.ActionListener
;
6 import javax
.swing
.JButton
;
7 import javax
.swing
.JFrame
;
8 import javax
.swing
.JLabel
;
10 public class SwingTestUi
{
11 private static void createAndShowGUI() {
12 // Create and set up the window.
13 JFrame frame
= new JFrame("HelloWorldSwing");
14 frame
.setDefaultCloseOperation(JFrame
.EXIT_ON_CLOSE
);
16 // Add the ubiquitous "Hello World" label.
17 final JLabel label
= new JLabel("Hello World");
18 frame
.getContentPane().add(label
);
20 final JButton button
= new JButton("Button");
21 frame
.getContentPane().add(button
);
22 button
.addActionListener(new ActionListener() {
25 public void actionPerformed(ActionEvent e
) {
26 button
.setText("Pressed!!");
30 // Display the window.
32 frame
.setVisible(true);
35 public static void main(String
[] args
) {
36 // Schedule a job for the event-dispatching thread:
37 // creating and showing this application's GUI.
38 javax
.swing
.SwingUtilities
.invokeLater(new Runnable() {