Added first log in buttons
parent
9a0cb19f79
commit
1a6983fc2e
|
@ -1,19 +0,0 @@
|
||||||
package gui;
|
|
||||||
|
|
||||||
import javax.swing.JFrame;
|
|
||||||
|
|
||||||
|
|
||||||
public class Gui {
|
|
||||||
public static void main(String[] args) {
|
|
||||||
JFrame jf = new JFrame();
|
|
||||||
|
|
||||||
jf.setTitle("Travel Buddy");
|
|
||||||
jf.setSize(400, 300);
|
|
||||||
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
||||||
|
|
||||||
|
|
||||||
jf.setVisible(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
package gui;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
|
||||||
|
|
||||||
|
public class GuiMain extends JFrame implements ActionListener {
|
||||||
|
JLabel headerText;
|
||||||
|
JButton createAcc;
|
||||||
|
// JTextField headerText;
|
||||||
|
|
||||||
|
|
||||||
|
public GuiMain(){
|
||||||
|
//? Creating the jFrame object with some parameters
|
||||||
|
this.setTitle("Travel Buddy");
|
||||||
|
this.setSize(400, 300);
|
||||||
|
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
|
|
||||||
|
headerText = new JLabel("Log In");
|
||||||
|
JPanel upper = new JPanel();
|
||||||
|
|
||||||
|
upper.add(headerText);
|
||||||
|
|
||||||
|
JPanel lower = new JPanel();
|
||||||
|
createAcc = new JButton("Create Account");
|
||||||
|
createAcc.addActionListener(this);
|
||||||
|
|
||||||
|
lower.add(createAcc);
|
||||||
|
|
||||||
|
this.add(upper, "North");
|
||||||
|
this.add(lower, "South");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
GuiMain gui = new GuiMain();
|
||||||
|
gui.setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue