Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java GUI 设计 » Swing  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 请问怎样在多文档的主界面上加上工具栏啊?
herong





发贴: 10
积分: 0
于 2006-03-12 19:37 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
小弟是新手,现在想做一个MDI的程序,可是不知道怎样在主窗口上添加工具栏。菜单栏倒是可以加上。刚才搜索了一下论坛,也没有相关的帖子。希望各位大侠帮帮忙,小弟先行谢过啦!:)


作者 Re:请问怎样在多文档的主界面上加上工具栏啊? [Re:herong]
Skybus

黄昏日晕



发贴: 111
积分: 6
于 2006-03-12 21:32 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
see the java api about javax.swing.Jtoolbar.*;


It's very hard to start!
作者 Re:请问怎样在多文档的主界面上加上工具栏啊? [Re:herong]
herong





发贴: 10
积分: 0
于 2006-03-13 22:53 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
可是当将JDesktopPane设置为JFrame的ContentPane之后,JToolBar就显示不出来了。也是,JToolBar是要求要有BorderLayout的,但JDesktoPane不是这样的布局器……


作者 Re:请问怎样在多文档的主界面上加上工具栏啊? [Re:herong]
yzdbj





发贴: 9
积分: 0
于 2006-03-17 00:40 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
MDI的窗体设计思路:先建一个JPanel、JDesktopPane和JToolbar,将JPanel放在JFrame上,设置Jpanel的步局,JPanel加上JDesktopPane,将JToolbar加到JPanel上的某个方位(位置),以后建立的子窗体可直接加到JDesktopPane上!!

For example:
public class Test extends JFrame {
JPanel jp;
JDesktopPane jdp;
JToolbar jtbTop;
public Test(){
jp = new JPanel();
jdp = new JDesktopPane();
jtbTop=new JToolbar();
this.setContentPane(jp);
jp.setLayout(new BorderLayout()) ;
jp.add(jdp);
jp.add(jtbTop,BorderLayout.NORTH );
}
}



作者 Re:请问怎样在多文档的主界面上加上工具栏啊? [Re:herong]
JavaandC





发贴: 230
积分: 15
于 2006-03-17 08:50 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
可以利用JToolBar来做工具栏。相关JToolBar的资料,参见Java-API中的 javax.swing.JToolBar


作者 Re:请问怎样在多文档的主界面上加上工具栏啊? [Re:herong]
herong





发贴: 10
积分: 0
于 2006-03-20 22:17 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
谢谢,我现在决定不用MDI了:)



flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923