I have been mucking about with Java swing lately but it's butt ugly! Are most people who write Java GUI's using swing or something else? I would really appreciate a recommendation. I don't want to use a GUI builder because I need to learn how everything works first.
我最近一直在玩Java swing,但是它太丑了!大多数编写Java GUI的人是使用swing还是其他东西?非常感谢您的推荐。我不想使用GUI构建器,因为我需要首先了解所有东西是如何工作的。
Thanks!
谢谢!
8 个解决方案
#1
10
Most people use Swing.
大多数人使用。
Some use SWT, but you have to dispose object after use. (no auto dispose in Garbage collecting) It give very native look UI.
有些使用SWT,但使用后必须处理对象。(没有自动处理垃圾收集)它提供非常原生的外观UI。
Some use Qt-Jambi, but then you have to understand some C++ code. Most of them are for interoperating with Qt.
有些人使用Qt-Jambi,但是你必须理解一些c++代码。它们大部分是用于与Qt交互的。
Some ancient code use AWT. Most of them are for legacy reason. I recommend avoid it.
一些古老的代码使用AWT。大部分都是由于遗产原因。我建议避免它。
#2
10
If you don't like the default Swing look'n'feel, you can change it ; many ready-built themes exist. And it is quite possible to build beautiful and ergonomic applications with Swing : take a look at Netbeans or IntelliJ.
如果你不喜欢默认的Swing外观,你可以改变它;存在许多ready-built主题。使用Swing构建美观、符合人体工程学的应用程序是完全可能的:看看Netbeans或IntelliJ。
But if you definitely want to use another graphic toolkit, you can try SWT. Contrary to Swing that is pure Java, SWT uses native controls as much as possible (those provided by your OS), and emulates the missing ones. It was developed for, and is used by, the Eclipse platform.
但是如果您确实想使用另一个图形工具包,您可以尝试SWT。与纯Java的Swing相反,SWT尽可能使用本机控件(由您的OS提供的控件),并模拟丢失的控件。它是为Eclipse平台开发并使用的。
#3
4
I have been mucking about with Java swing lately but it's butt ugly!
我最近一直在玩Java swing,但是它太丑了!
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {}
Are most people who write Java GUI's using swing
大多数编写Java GUI的人都使用swing吗
For most things, yes. It's built-in, and doesn't suck that bad for a cross-platform GUI library (which all suck to some extent).
对大多数事情来说,是的。它是内置的,对于跨平台的GUI库(在某种程度上,它们都很糟糕)来说并不是那么糟糕。
#4
4
- SWT
- SWT
- Spring-RCP (ontop of swing)
- Spring-RCP(swing的攻击)
By the way, Swing's Look and Feel can be customized. There are some pretty good LaFs. See here how to change the look and feel.
顺便说一下,Swing的外观和感觉都可以定制。有一些相当不错的LaFs。看看这里如何改变外观和感觉。
Check this question for how to change the look and feel and for a list of nice look and feels
检查一下这个问题,看看如何改变你的外表和感觉,并列出一些好看的外观和感觉
#5
2
SWT is very good. It tries to use native GUI drawing functions wherever possible. An example of application written with SWT is Eclipse IDE.
SWT很好。它尽量使用本地GUI绘图功能。使用SWT编写的应用程序示例是Eclipse IDE。
http://www.eclipse.org/swt/
#6
1
you can use native look and feel with swing, thus it's less ugly. Personnally, I use swing for my GUIs in java, and I find it quite straight forward and documented.
你可以在swing中使用本机外观和感觉,这样就不那么难看了。就个人而言,我在java中为gui使用swing,我发现它非常直接,并且有文档记录。
Here is a link toward swing documentation:
这里有一个指向swing文档的链接:
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
#7
1
The only thing is ugly in Swing is standart layout manages. They are or too primitive or too complicated. If you really want to write nice gui without gui builders take a look at alternative layout managers. For example Table layout https://tablelayout.dev.java.net/
在Swing中惟一难看的地方就是标准化布局管理。它们要么太原始,要么太复杂。如果你真的想在没有gui构建器的情况下编写漂亮的gui,那就看看其他的布局管理器吧。例如,表布局https://tablelayout.dev.java.net/
#8
0
Look to SWT http://www.eclipse.org/swt/ - Eclipse entirely built on it.
查看SWT http://www.eclipse.org/swt/ - Eclipse完全建立在它之上。
#1
10
Most people use Swing.
大多数人使用。
Some use SWT, but you have to dispose object after use. (no auto dispose in Garbage collecting) It give very native look UI.
有些使用SWT,但使用后必须处理对象。(没有自动处理垃圾收集)它提供非常原生的外观UI。
Some use Qt-Jambi, but then you have to understand some C++ code. Most of them are for interoperating with Qt.
有些人使用Qt-Jambi,但是你必须理解一些c++代码。它们大部分是用于与Qt交互的。
Some ancient code use AWT. Most of them are for legacy reason. I recommend avoid it.
一些古老的代码使用AWT。大部分都是由于遗产原因。我建议避免它。
#2
10
If you don't like the default Swing look'n'feel, you can change it ; many ready-built themes exist. And it is quite possible to build beautiful and ergonomic applications with Swing : take a look at Netbeans or IntelliJ.
如果你不喜欢默认的Swing外观,你可以改变它;存在许多ready-built主题。使用Swing构建美观、符合人体工程学的应用程序是完全可能的:看看Netbeans或IntelliJ。
But if you definitely want to use another graphic toolkit, you can try SWT. Contrary to Swing that is pure Java, SWT uses native controls as much as possible (those provided by your OS), and emulates the missing ones. It was developed for, and is used by, the Eclipse platform.
但是如果您确实想使用另一个图形工具包,您可以尝试SWT。与纯Java的Swing相反,SWT尽可能使用本机控件(由您的OS提供的控件),并模拟丢失的控件。它是为Eclipse平台开发并使用的。
#3
4
I have been mucking about with Java swing lately but it's butt ugly!
我最近一直在玩Java swing,但是它太丑了!
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {}
Are most people who write Java GUI's using swing
大多数编写Java GUI的人都使用swing吗
For most things, yes. It's built-in, and doesn't suck that bad for a cross-platform GUI library (which all suck to some extent).
对大多数事情来说,是的。它是内置的,对于跨平台的GUI库(在某种程度上,它们都很糟糕)来说并不是那么糟糕。
#4
4
- SWT
- SWT
- Spring-RCP (ontop of swing)
- Spring-RCP(swing的攻击)
By the way, Swing's Look and Feel can be customized. There are some pretty good LaFs. See here how to change the look and feel.
顺便说一下,Swing的外观和感觉都可以定制。有一些相当不错的LaFs。看看这里如何改变外观和感觉。
Check this question for how to change the look and feel and for a list of nice look and feels
检查一下这个问题,看看如何改变你的外表和感觉,并列出一些好看的外观和感觉
#5
2
SWT is very good. It tries to use native GUI drawing functions wherever possible. An example of application written with SWT is Eclipse IDE.
SWT很好。它尽量使用本地GUI绘图功能。使用SWT编写的应用程序示例是Eclipse IDE。
http://www.eclipse.org/swt/
#6
1
you can use native look and feel with swing, thus it's less ugly. Personnally, I use swing for my GUIs in java, and I find it quite straight forward and documented.
你可以在swing中使用本机外观和感觉,这样就不那么难看了。就个人而言,我在java中为gui使用swing,我发现它非常直接,并且有文档记录。
Here is a link toward swing documentation:
这里有一个指向swing文档的链接:
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
#7
1
The only thing is ugly in Swing is standart layout manages. They are or too primitive or too complicated. If you really want to write nice gui without gui builders take a look at alternative layout managers. For example Table layout https://tablelayout.dev.java.net/
在Swing中惟一难看的地方就是标准化布局管理。它们要么太原始,要么太复杂。如果你真的想在没有gui构建器的情况下编写漂亮的gui,那就看看其他的布局管理器吧。例如,表布局https://tablelayout.dev.java.net/
#8
0
Look to SWT http://www.eclipse.org/swt/ - Eclipse entirely built on it.
查看SWT http://www.eclipse.org/swt/ - Eclipse完全建立在它之上。