当前位置: 代码迷 >> Java相关 >> 狂求助,昨天弄一天了,用Swing填加个菜单
  详细解决方案

狂求助,昨天弄一天了,用Swing填加个菜单

热度:214   发布时间:2006-08-07 13:18:49.0
8楼那个能看见么?
从哪浏览啊 ?
----------------解决方案--------------------------------------------------------
看8楼 就是我给你改的那个程序
----------------解决方案--------------------------------------------------------
8楼的看不见,你点回复,会进入高级选项的,那里面有上传附件..把你的图浏览到再点上传就成了
----------------解决方案--------------------------------------------------------

混了这么久还不会发图片
真丢人

----------------解决方案--------------------------------------------------------
以下是引用韩峰在2006-8-7 13:36:14的发言:
document.body.clientWidth*0.5) {this.resized=true;this.width=document.body.clientWidth*0.5;this.style.cursor='pointer';} else {this.onclick=null}" alt="" />
混了这么久还不会发图片
真丢人

8楼发了有个X,哈哈,真丢人。


----------------解决方案--------------------------------------------------------
现在会了
----------------解决方案--------------------------------------------------------
我的代码你一点都没有改吗?
就出来这个效果了?
----------------解决方案--------------------------------------------------------
注意我的文件名是Test
import javax.swing.*;
import java.awt.*;
/*主窗体*/
public class Test extends JFrame
{
public Test(String str)
{
super(str);
}

public static void main(String [] args)
{
Test fr = new Test("aaaaa");
fr.setSize(400, 500);
fr.menu();
fr.setVisible(true);
//添加菜单方法
}

public void menu()
{
/*菜单*/
JMenuBar mu = new JMenuBar();
mu.setVisible(true);

JMenu menu_game = new JMenu("游戏");
JMenu menu_set = new JMenu("设置");
JMenu menu_help = new JMenu("帮助");

JMenuItem itemG1 = new JMenuItem("开始");
JMenuItem itemG2 = new JMenuItem("暂停");
JMenuItem itemG3 = new JMenuItem("继续");
JMenuItem itemG4 = new JMenuItem("退出");

JMenuItem itemS1 = new JMenuItem("背景色");

JMenuItem itemH1 = new JMenuItem("帮助");


mu.add(menu_game);
mu.add(menu_set);
mu.add(menu_help);

/*在游戏菜单下添加子菜单*/
menu_game.add(itemG1);
menu_game.add(itemG2);
menu_game.add(itemG3);
menu_game.add(itemG4);
/*在设置菜单下添加子菜单*/
menu_set.add(itemS1);
/*在帮助菜单下添加子菜单*/
menu_help.add(itemH1);

mu.setBounds(0, 0, 100, 40);//菜单之间的位置

setJMenuBar(mu);//把菜单加到主窗体中
}
}
----------------解决方案--------------------------------------------------------
就是2楼跟你说的那么改的
----------------解决方案--------------------------------------------------------
谢谢问题解决了~~~

谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!谢谢峰哥!
----------------解决方案--------------------------------------------------------