반응형
import java.awt.*;
public class awtex2 {
public static void main(String args[]){
Frame f = new Frame("Pulldown Menu");
MenuBar mb = new MenuBar();
Menu m = new Menu("Menu1");
m.add(new MenuItem("MenuItem1"));
Menu sm = new Menu("SubMenu1");
sm.add(new MenuItem("SubmenuItem1"));
sm.add(new MenuItem("SubmenuItem2"));
m.add(sm);
m.add(new MenuItem("MenuItem2"));
mb.add(m);
f.setMenuBar(mb);
f.setSize(200, 200);
f.setBackground(Color.WHITE);
f.setVisible(true);
}
}
반응형
'Programming > Java_Etc' 카테고리의 다른 글
AWT Study - FileDialog 사용하기 (2) | 2020.02.11 |
---|---|
AWT Study - 팝업메뉴 (0) | 2020.02.11 |
AWT Study - Window & Frame (0) | 2020.02.11 |
Java 막대 그래프 그리기2 (0) | 2020.02.08 |
Database Connection - DBConnection.java (0) | 2020.01.29 |