I am new to java programming and I wish to know how can I call jframe F1 from applet code which is below:
public void actionPerformed(ActionEvent ae) {
str=ae.getActionCommand();
if(str=="SUBMIT")
{
if(type.getSelectedItem().toString()=="EMPLOYEE")
{
//if(t1.getText().equals("E101") && t2.getText().equals("123"))
{
F1 f1=new F1();
}
}
}
}
//Here is the Jframe code:
class F1 extends JFrame{
JButton submit;
public F1()
{
setExtendedState(java.awt.Frame.MAXIMIZED_BOTH);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
initComponents();
}
private void initComponents()
{
submit=new JButton("SUBMIT");
this.setVisible(true);
this.getContentPane().setLayout(new BorderLayout());
this.setContentPane(new JLabel(new ImageIcon("f1bge.jpg")));
this.getContentPane().setLayout(null);
this.getContentPane().add(submit);
submit.setBounds(860, 150, 73, 23);
}
}
I am trying to execute it through applet viewer but it results in an empty frame. Please guide.