This commit is contained in:
ldy
2026-03-01 23:18:55 -05:00
commit 67f753a5d1
3087 changed files with 218259 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Question5</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8

Binary file not shown.

View File

@@ -0,0 +1,56 @@
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title");
this.setSize(400, 300);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLocationRelativeTo(null);
this.setLayout(new BorderLayout()); //Global Layout manager
JPanel p1 = new JPanel(); //first panel
p1.setLayout(new BorderLayout()); //set panel Layout
this.add(p1, BorderLayout.PAGE_START); //add
p1.setBackground(Color.BLUE); //change background color
p1.add(new JButton("b1"), BorderLayout.LINE_START); //add 2 buttons
p1.add(new JButton("b2"), BorderLayout.LINE_END);
JPanel p2 = new JPanel(); //second panel
p2.setLayout(new FlowLayout(FlowLayout.CENTER));
this.add(p2, BorderLayout.CENTER);
p2.setBackground(Color.GREEN);
JLabel l = new JLabel("Enter your name: ");
p2.add(l);
JTextField tx = new JTextField("Type Text Here");
p2.add(tx);
JPanel p3 = new JPanel(); //third panel
p3.setLayout(new GridLayout(2, 2));
this.add(p3, BorderLayout.PAGE_END);
JCheckBox cb = new JCheckBox("I agree");
p3.add(cb);
JRadioButton rb = new JRadioButton("Yes");
p3.add(rb);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
p3.add(cb1);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
p3.add(cb2);
this.setVisible(true);
}
}

View File

@@ -0,0 +1,13 @@
public class Start {
public static void main(String[] args) {
javax.swing.SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
new MyFrame();
}
});
}
}