简体   繁体   English

多个JFrame或JDialog

[英]Multiple JFrame or JDialog

I'm developing an application with Swing and there is a situation that I couldn't decide to what to do. 我正在使用Swing开发应用程序,但是有一种情况我无法决定要做什么。 I need multiple pages but; 我需要多页,但是;

  • Should I use multiple JFrame or JDialog or something else? 我应该使用多个JFrame还是JDialog或其他?
  • What are the advantages of them? 它们的优点是什么? Is there specific way to choose? 有没有具体的选择方法?

I would use JDesktopPane with JInternalFrame s. 我将JDesktopPaneJInternalFrame一起使用。 With that technique you can create as many windows as you need. 使用该技术,您可以根据需要创建任意多个窗口。 A good place to start with this is here: https://docs.oracle.com/javase/tutorial/uiswing/components/internalframe.html . 从这里开始的好地方是: https : //docs.oracle.com/javase/tutorial/uiswing/components/internalframe.html

You can also use multiple JTabbedPane in a JFrame which will make your work eassier. 您还可以在JFrame中使用多个JTabbedPane,这将使您的工作更加轻松。

see the link below: 请参阅下面的链接:

https://docs.oracle.com/javase/tutorial/uiswing/components/tabbedpane.html https://docs.oracle.com/javase/tutorial/uiswing/components/tabbedpane.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM