Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import javax.swing.*;
- public class SwingCounter extends JFrame{
- public SwingCounter(String title){
- setTitle(title);
- setLayout(new FlowLayout(FlowLayout.LEFT,10,20));
- add(new JLabel("Counter"));
- add(new JTextField(10));
- JButton btnOK = new JButton("Count");
- add(btnOK);
- }
- public static void main(String s[]) {
- SwingCounter frame = new SwingCounter("Swing Counter");
- frame.setSize(300, 100);
- frame.setLocationRelativeTo(null);
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.setVisible(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement