0% found this document useful (0 votes)
6 views

GUI

Uploaded by

ahmed bader
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

GUI

Uploaded by

ahmed bader
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

package gui;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;

public class Gui extends JFrame{


public Gui(){
setLayout(null);
setSize(300, 150);
setVisible(true);
setTitle("login screen");
setResizable(false);
setLocation(400,250);
setDefaultCloseOperation(EXIT_ON_CLOSE);
JButton btn1=new JButton("login");
JButton btn2=new JButton("canacel");
JButton btn3=new JButton("help");

btn1.setBounds(10,70,80,20);
btn2.setBounds(100,70,80,20);
btn3.setBounds(190,70,80,20);
add(btn1);
add(btn2);
add(btn3);

JLabel lab1=new JLabel("username");


JLabel lab2=new JLabel("password");
lab1.setBounds(10,10,80,20);
lab2.setBounds(10,40,80,20);
add(lab1);
add(lab2);
JTextField txt1=new JTextField();
JTextField txt2=new JTextField();
txt1.setBounds(100,10,80,20);
txt2.setBounds(100,40,80,20);
add(txt1);
add(txt2);
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
new Gui();
}

You might also like