The frame displayed is not using the parameters and buttons mentioned. Help me to resolve the issue.
package MyEmployeePackage.MyUtilityPackage;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class myUtilityClass{
public static void main(){
myFirstPage mypage=new myFirstPage();
mypage.displayMyFirstPage();
mypage.frm1.setVisible(true);
}
}
class myFirstPage {
myFrame frm1;
myButton btnEmployee,btnDepartment,btnRegulation,btnEmploye eResponse,btnExit;
myFirstPage(){
frm1= new myFrame();
//frm.setSize(400,500);
}
void displayMyFirstPage(){
btnEmployee = new myButton("Employee");
frm1.addButton(btnEmployee);
}
}
class myFrame extends JFrame{
private JFrame frm;
private JPanel pnl;
myFrame (){
frm = new JFrame();
pnl =new JPanel();
frm.setSize(500,400);
frm.setLocation(400,200);
frm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) ;
frm.add(pnl);
}
void addButton(JButton btn){
pnl.add(btn);
}
}
class myButton extends JButton{
JButton btn;
Color btnColorForegroud;
Color btnColorBackgroud;
myButton(String str){
btn= new JButton(str);
btnColorForegroud = new Color(79,81,228);
btnColorBackgroud = new Color(240,221,186);
btn.setPreferredSize(new Dimension(100,50));
btn.setForeground(btnColorForegroud);
btn.setBackground(btnColorBackgroud);
}
}