由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - A rookie question on Java GUI
相关主题
Java线程一问java update main UI from child thread issue
如何让Swing对象即使更新?Eclipse vs. Jbuilder X ?
工作中遇到的并行处理问题java在美国到底怎样?
JavaFXSun公司最近有啥突飞猛进不?
问一下swing的前途eclipse里面做gui有什么好的插件么?
大牛们能不能谈谈core java?应该站哪条队:.NET 还是 Java/J2EE?
Java里面的SWT或者Swing为啥还有书在介绍呢which IDE for GUI ?
请问一个语法问题Java Swing的UI开发很落后啊
相关话题的讨论汇总
话题: gui话题: thread话题: java话题: actions
进入Java版参与讨论
1 (共1页)
f*******g
发帖数: 55
1
I'm working on a multithread Java program: one thread for some computations
and the other thread for GUI. I'm trying to show the results of the
computation thread on the GUI in real time, but I'm not sure how to notify
the GUI thread when the results are updated. I checked some tutorials on
event handling, but all of them are about handling the actions by users. Is
there a way to handle the actions by another thread? Thanks a lot!
D**C
发帖数: 6754
2
observer design pattern

computations
Is

【在 f*******g 的大作中提到】
: I'm working on a multithread Java program: one thread for some computations
: and the other thread for GUI. I'm trying to show the results of the
: computation thread on the GUI in real time, but I'm not sure how to notify
: the GUI thread when the results are updated. I checked some tutorials on
: event handling, but all of them are about handling the actions by users. Is
: there a way to handle the actions by another thread? Thanks a lot!

o**2
发帖数: 168
3
FMP 支持 JavaFX, Swing and SWT 中的 UI thread
http://www.mitbbs.com/article_t/Programming/31254349.html
o**2
发帖数: 168
4
It is available through maven central repository.
http://search.maven.org/remotecontent?filepath=com/fastmessenge
z*******3
发帖数: 13709
5
你说的是哪一个ui?
awt, swing还是javafx?
javafx需要你更改现有代码,用上InegerProperty, StringPorperty这些
然后再将ui的property绑定到这些property上去
http://docs.oracle.com/javafx/2/binding/jfxpub-binding.htm
如果是swing的话,参考这篇文章
http://docs.oracle.com/javase/tutorial/uiswing/components/progr
如果是awt的话,你需要自己手动处理闪烁等问题
每次刷新屏幕的时候,就去结果里面轮询一下就是了
b***i
发帖数: 3043
6
以Swing为例,有一个JTextPane jTP;你自己在开始的时候在UI线程初始化。
一般在计算线程里面SwingUtilities.invokeLater(new Runnable(){
public void run(){
jTP.setText("new stuff here");
jTP.setVisible, setEnabled, color, font, whatever change can be done here.
}});
如果是绘图,有其他的方案。

computations
Is

【在 f*******g 的大作中提到】
: I'm working on a multithread Java program: one thread for some computations
: and the other thread for GUI. I'm trying to show the results of the
: computation thread on the GUI in real time, but I'm not sure how to notify
: the GUI thread when the results are updated. I checked some tutorials on
: event handling, but all of them are about handling the actions by users. Is
: there a way to handle the actions by another thread? Thanks a lot!

c*********e
发帖数: 16335
7
难道我是穿越了,这年月还有人用swing?

【在 b***i 的大作中提到】
: 以Swing为例,有一个JTextPane jTP;你自己在开始的时候在UI线程初始化。
: 一般在计算线程里面SwingUtilities.invokeLater(new Runnable(){
: public void run(){
: jTP.setText("new stuff here");
: jTP.setVisible, setEnabled, color, font, whatever change can be done here.
: }});
: 如果是绘图,有其他的方案。
:
: computations
: Is

l*********s
发帖数: 5409
8
那用啥?

【在 c*********e 的大作中提到】
: 难道我是穿越了,这年月还有人用swing?
D**C
发帖数: 6754
9
那用啥

【在 c*********e 的大作中提到】
: 难道我是穿越了,这年月还有人用swing?
z*******3
发帖数: 13709
10
javafx

【在 D**C 的大作中提到】
: 那用啥
b***i
发帖数: 3043
11
Java SE确定带fx了吗?

【在 z*******3 的大作中提到】
: javafx
1 (共1页)
进入Java版参与讨论
相关主题
Java Swing的UI开发很落后啊问一下swing的前途
初学Java, FormLayout一问大牛们能不能谈谈core java?
JavaFX is actually quite powerfulJava里面的SWT或者Swing为啥还有书在介绍呢
eclipse 怪问题请问一个语法问题
Java线程一问java update main UI from child thread issue
如何让Swing对象即使更新?Eclipse vs. Jbuilder X ?
工作中遇到的并行处理问题java在美国到底怎样?
JavaFXSun公司最近有啥突飞猛进不?
相关话题的讨论汇总
话题: gui话题: thread话题: java话题: actions