0% found this document useful (0 votes)
25 views2 pages

Question: What Is The Output Displayed For Each File? Understand The Codes Before Framebutang - Java (Output)

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 2

Question: What is the output displayed for each file?

Understand the codes before


completing exercise below.
FrameButang.java (Output)
Exit Button
Button : Merah, Biru Hijau, Putih
Title : Aplikasi Frame Butang
Window Size : 300 x 200
Visible : True

FrameButang2.java (output)
Choose Language :

Java (tick box)


C
C++ (tick box)
Python
Ruby
Ok

Exit Button
Title : Aplikasi Frame Butang
Window size : 300 x 200
Visible : True

LoginUI.java (output)
Name : Enter your name here
Matric No :
Password :
Login Button

Title : LoginUI
Window size : 300 x 200
Visible : True

Question 7 : Write a java codes to display the output as below:


public class LoginUI extends JFrame{
public LoginUI() {
Container pane = getContentPane();
pane.setBackground(Color.yellow);
pane.setLayout(new FlowLayout());
pane.add(new JLabel("Name: "));
pane.add(new JTextField("Enter name here", 10));
pane.add(new JLabel("Matric no: "));
pane.add(new JTextField(5));
pane.add(new JLabel("Choose your program: "));
pane.add(new JCheckBox("DCS", true));
pane.add(new JCheckBox("DEC"));
pane.add(new JCheckBox("DIT"));
pane.add(new JCheckBox("BSE"));
pane.add(new JCheckBox("BIT"));
pane.add(new JCheckBox("BCNT"));
pane.add(new JLabel("Password: "));
pane.add(new JPasswordField(10));
pane.add(new JButton("Register"));
pane.add(new JButton("Cancel"));
}
public static void main(String [] args) {
LoginUI frame = new LoginUI();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setTitle("Student Registration");
frame.setSize(200, 300);
frame. setVisible(true);
}
}

You might also like