Content deleted Content added
→Hello World doesn't run?: Trying desperately to kill off the completely incorrect examples. |
m Collecting the comments about the Swing example. It is plainly AMAZING how much incorrect understanding there is about this, and it AMAZES me that people destroys a correct example to becom incorrect. |
||
Line 56:
}
}
=== Cryptic example ===▼
What's the Event Dispatch Thread? What's an anonymous Runnable class? Why do I have to go to the Concurrency tutorial to just show a label and a button? What rules changed in 2004? OK I don't really ask these questions, but I doubt that anyone who don't know about Swing will understand something about Swing with the example. Maybe he will understand that Swing is an overcomplicated affair and that he should stay clear of it and use Flex or C# instead ;) I'm kidding because I love to use Swing, but I doubt that in it's current state this example is useful at all, even if it is legit. [[User:Hervegirod|Hervegirod]] ([[User talk:Hervegirod|talk]]) 00:31, 6 November 2009 (UTC)▼
:Yes this is a bit awkward. However it only requires 4 lines▼
<pre>▼
EventQueue.invokeLater(new Runnable() {▼
@Override▼
public void run() {▼
....▼
}});▼
</pre>▼
:of standard boiler plate code to get thread safe behaviour. You can miss this out and it will probably work. However, I don't think it would be right to show technically incorrect code and bad practice. ▼
:One way of organising this would be to have a code fragment first with just the Swing bits. Then introducing the threading example later.--[[User:Salix alba|Salix]] ([[User talk:Salix alba|talk]]): 07:34, 6 November 2009 (UTC)▼
== JAVA SWING ==
Line 90 ⟶ 104:
Every GUI framework that puts pixels on screens are single threaded, it's just a question of how they present it to the user. Flex disallows threading entirely, for example. Really Swing has only one thread allowed to touch pixels and objects representing the widgets, but any number of threads that can do anything else. Swing is merely upfront about it's nature. [[Special:Contributions/75.173.228.67|75.173.228.67]] ([[User talk:75.173.228.67|talk]]) 04:43, 28 June 2009 (UTC)
▲== Cryptic example ==
▲What's the Event Dispatch Thread? What's an anonymous Runnable class? Why do I have to go to the Concurrency tutorial to just show a label and a button? What rules changed in 2004? OK I don't really ask these questions, but I doubt that anyone who don't know about Swing will understand something about Swing with the example. Maybe he will understand that Swing is an overcomplicated affair and that he should stay clear of it and use Flex or C# instead ;) I'm kidding because I love to use Swing, but I doubt that in it's current state this example is useful at all, even if it is legit. [[User:Hervegirod|Hervegirod]] ([[User talk:Hervegirod|talk]]) 00:31, 6 November 2009 (UTC)
▲:Yes this is a bit awkward. However it only requires 4 lines
▲<pre>
▲ EventQueue.invokeLater(new Runnable() {
▲ @Override
▲ public void run() {
▲ ....
▲ }});
▲</pre>
▲:of standard boiler plate code to get thread safe behaviour. You can miss this out and it will probably work. However, I don't think it would be right to show technically incorrect code and bad practice.
▲:One way of organising this would be to have a code fragment first with just the Swing bits. Then introducing the threading example later.--[[User:Salix alba|Salix]] ([[User talk:Salix alba|talk]]): 07:34, 6 November 2009 (UTC)
== download ==
|