Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package notesapplication;
- import java.awt.BorderLayout;
- import java.awt.Dimension;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.sql.SQLException;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.JMenu;
- import javax.swing.JMenuBar;
- import javax.swing.JMenuItem;
- import javax.swing.JOptionPane;
- public class NotesApplication extends JFrame {
- public NotesApplication() {
- setTitle("Notes");
- setLayout(new BorderLayout());
- JMenuBar menuBar = new JMenuBar();
- setJMenuBar(menuBar);
- JMenu fileMenu = new JMenu("File");
- menuBar.add(fileMenu);
- JMenuItem exitMenuItem = new JMenuItem("Exit");
- fileMenu.add(exitMenuItem);
- exitMenuItem.addActionListener((ActionEvent e) -> {
- System.exit(0);
- });
- JMenu setupMenu = new JMenu("Setup");
- menuBar.add(setupMenu);
- JMenuItem UsersMenuItem = new JMenuItem("User");
- setupMenu.add(UsersMenuItem);
- UsersMenuItem.addActionListener((e) -> {
- UsersDialog dialog = new UsersDialog();
- dialog.setVisible(true);
- });
- JLabel label = new JLabel("Notes Application", JLabel.CENTER);
- label.setPreferredSize(new Dimension(500, 500));
- add(label, BorderLayout.CENTER);
- pack();
- setDefaultCloseOperation(EXIT_ON_CLOSE);
- }
- public static void main(String[] args) {
- new NotesApplication().setVisible(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement