This exercise is based off of the JFrameObjects video listed on the Week 11 Assi
ID: 3701476 • Letter: T
Question
This exercise is based off of the JFrameObjects video listed on the Week 11 Assignment page. This Exercise will be graded Manually
Create a Hybrid JFrame object as described in the video with two JPanels and two JButton objects, one on each JPanel. Use the FlowLayout as shown in the video
REQUIRED FOR CREDIT:
The HybridGUI class extends the JFrame object and the full student name for a title
The HybridGUI class contains 2 JPanels and 2 JButtons
The HybridGUI class has FlowLayout, displays correctly and closes correctly
HybridGUI -The First JButton has the student's username on it.
HybridGUI -The second JButton has the course name on it as a label.
The Code:
import javax.swing.*;
import java.awt.*;
/**
* Enter JavaDoc Class information here
* Include a description of what this class does!!!
* Make sure you include your full name
* Filename: HybridGUI.java
*/
public class HybridGUI {
// ******* enter code here ************
} // end HybridGUI class
Explanation / Answer
here is your code : -------->>>>>>>>>>
import javax.swing.*;
import java.awt.*;
/**
* Enter JavaDoc Class information here
* Include a description of what this class does!!!
* Make sure you include your full name
* Filename: HybridGUI.java
*/
public class HybridGUI extends JFrame{
// ******* enter code here ************
JPanel j1,j2;
JButton uid,cname;
HybridGUI(){
super("Student Full Name Here");
setSize(400,400);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
buildGUI();
setVisible(true);
}
public void buildGUI(){
uid = new JButton("your user id Here");
cname = new JButton("course name Here");
j1 = new JPanel();
j2 = new JPanel();
setLayout(new FlowLayout());
j1.add(uid);
j2.add(cname);
add(j1);
add(j2);
}
public static void main(String[] args) {
HybridGUI h = new HybridGUI();
}
} // end HybridGUI class
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.