Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import java.awt.event.*;
- import javax.swing.*;
- class Windowabc extends JFrame
- {private JLabel l;
- private JTextField tf;
- private JButton b;
- public Windowabc(){
- setTitle("Sorting files program");
- setLayout(null);
- setSize(400,300);
- setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- l = new JLabel("Enter the path of Directory:");
- l.setSize(200,30);
- l.setLocation(20,20);
- add(l);
- tf = new JTextField(30);
- tf.setSize(100,40);
- tf.setLocation(140,80);
- tf.setToolTipText("Enter the path in textfield:");
- add(tf);
- b = new JButton("OK");
- b.setSize(100,20);
- b.setLocation(240,260);
- b.setToolTipText("OK Button");
- b.addActionListener(new ActionListener(){
- public void actionPerformed(ActionEvent e)
- {Toolkit.getDefaultToolkit().beep();//Function for beep sound
- }});
- add(b);
- setVisible(true);
- }
- }
- public class Directory
- {
- public static void main(String args[])
- {
- Windowabc w = new Windowabc();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement