Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import javax.swing.*;
- class MyJFrame01 extends JFrame{
- private JMenuBar menubar;
- private JMenu menu;
- MyJFrame01(String title){
- menubar = new JMenuBar();
- menu = new JMenu("メニュー");
- menubar.add(menu);
- setJMenuBar(menubar);
- setTitle(title);
- setSize(400,400);
- setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- setVisible(true);
- }
- }
- public class MenuProg01{
- public static void main(String[] args){
- MyJFrame01 frame = new MyJFrame01("メニュー作成_01");
- }
- }
Add Comment
Please, Sign In to add comment