Hi All,
See the home page
------------------------------------------------
package placement;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class Homepage extends JFrame implements ActionListener
{
JButton b1,b2,b3,b4;
JLabel l1;
public Homepage()
{
setTitle("home page");
setSize(500,500);
setLocationRelativeTo(null);
setVisible(true);
setLayout(new BorderLayout());
setContentPane(new JLabel(new ImageIcon("C:\\Users\\User\\Documents\\NetBeansProjects\\Placement\\src\\placement\\SSMS.jpg")));
setLayout(null);
setVisible(true);
// Homepage.setResizable(false);
l1=new JLabel("REMINDER MANAGEMENT SYSTEM");
l1.setFont(new Font("Courier New", Font.BOLD, 30));
//l1.setBounds(120, 10, 680, 30);
l1.setForeground(Color.MAGENTA);
b1=new JButton("Add Reminder");
b1.setBounds(380,80,180,30);
b2=new JButton("View Reminder");
b2.setBounds(380,140,180,30);
b3=new JButton("Update Reminder");
b3.setBounds(380,200,180,30);
b4=new JButton("Login");
b4.setBounds(570,270,90,30);
add(l1);
add(b1);
add(b2);
//this.add(l1);
b1.addActionListener(this);
b2.addActionListener(this);
// Just for refresh :) Not optional!
setSize(700,380);
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
WindowListener exitListener = new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
int confirm = JOptionPane.showOptionDialog(
null, "Are You Sure to Close Application?",
"Exit Confirmation", JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE, null, null, null);
if (confirm == 0) {
setVisible(false);
}
}
};
addWindowListener(exitListener);
}
public void actionPerformed(ActionEvent e)
{
String str=e.getActionCommand();
if(str.equals("Add Reminder"))
{
Skill mainFrame=new Skill();
mainFrame.setVisible(true);
setVisible(false);
}
else if(str.equals("View Reminder"))
{
Skillview mainFrame=new Skillview();
mainFrame.setVisible(true);
setVisible(false); }
}
public static void main(String args[])
{
new Homepage();
}
}
See the home page
------------------------------------------------
package placement;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class Homepage extends JFrame implements ActionListener
{
JButton b1,b2,b3,b4;
JLabel l1;
public Homepage()
{
setTitle("home page");
setSize(500,500);
setLocationRelativeTo(null);
setVisible(true);
setLayout(new BorderLayout());
setContentPane(new JLabel(new ImageIcon("C:\\Users\\User\\Documents\\NetBeansProjects\\Placement\\src\\placement\\SSMS.jpg")));
setLayout(null);
setVisible(true);
// Homepage.setResizable(false);
l1=new JLabel("REMINDER MANAGEMENT SYSTEM");
l1.setFont(new Font("Courier New", Font.BOLD, 30));
//l1.setBounds(120, 10, 680, 30);
l1.setForeground(Color.MAGENTA);
b1=new JButton("Add Reminder");
b1.setBounds(380,80,180,30);
b2=new JButton("View Reminder");
b2.setBounds(380,140,180,30);
b3=new JButton("Update Reminder");
b3.setBounds(380,200,180,30);
b4=new JButton("Login");
b4.setBounds(570,270,90,30);
add(l1);
add(b1);
add(b2);
//this.add(l1);
b1.addActionListener(this);
b2.addActionListener(this);
// Just for refresh :) Not optional!
setSize(700,380);
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
WindowListener exitListener = new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
int confirm = JOptionPane.showOptionDialog(
null, "Are You Sure to Close Application?",
"Exit Confirmation", JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE, null, null, null);
if (confirm == 0) {
setVisible(false);
}
}
};
addWindowListener(exitListener);
}
public void actionPerformed(ActionEvent e)
{
String str=e.getActionCommand();
if(str.equals("Add Reminder"))
{
Skill mainFrame=new Skill();
mainFrame.setVisible(true);
setVisible(false);
}
else if(str.equals("View Reminder"))
{
Skillview mainFrame=new Skillview();
mainFrame.setVisible(true);
setVisible(false); }
}
public static void main(String args[])
{
new Homepage();
}
}
No comments:
Post a Comment