2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
21
Task/Hello-world-Graphical/Java/hello-world-graphical-2.java
Normal file
21
Task/Hello-world-Graphical/Java/hello-world-graphical-2.java
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class HelloWorld {
|
||||
public static void main(String[] args) {
|
||||
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
JOptionPane.showMessageDialog(null, "Goodbye, world!");
|
||||
JFrame frame = new JFrame("Goodbye, world!");
|
||||
JTextArea text = new JTextArea("Goodbye, world!");
|
||||
JButton button = new JButton("Goodbye, world!");
|
||||
|
||||
frame.setLayout(new FlowLayout());
|
||||
frame.add(button);
|
||||
frame.add(text);
|
||||
frame.pack();
|
||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
frame.setVisible(true);
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue