Actually I am new to java so I want to know how we link these to files. After pressing Next Button it should change to Welcome Frame.
Enter.java
Welcome.javaimport java.awt.FlowLayout; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; public class Enter extends JFrame { public Enter() { // TODO Auto-generated constructor stub setLayout(new FlowLayout(FlowLayout.LEFT, 10, 20)); add(new JLabel("Name")); add(new JTextField(8)); add(new JLabel("Address")); add(new JTextField(15)); add(new JLabel("Surname")); add(new JTextField(8)); add(new JLabel("Phone")); add(new JTextField(8)); add(new JButton("Next")); } /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Enter myProg = new Enter(); myProg.setTitle("Ceng 344 - Lab 7"); myProg.setSize(450, 400); myProg.setLocationRelativeTo(null); myProg.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); myProg.setVisible(true); } }
import java.awt.FlowLayout; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; public class welcome extends JFrame { public welcome() { // TODO Auto-generated constructor stub setLayout(new FlowLayout(FlowLayout.LEFT, 10, 20)); add(new JLabel("Welcome")); } /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub welcome myProg = new welcome(); myProg.setTitle("Ceng 344 - Lab 7"); myProg.setSize(450, 400); myProg.setLocationRelativeTo(null); myProg.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); myProg.setVisible(true); } }