473,473 Members | 1,607 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Question for those familiar with Java ....

Hello,

I've done some Java in the past. I don't remember ever having to worry
about updating a control from a thread other than the one that created
it. In C# you have to jump throught a bunch of hoops to with Invoke/
BeginInvoke or use tricks with BackgroundWorker. I don't remember
having to do this with Java. Java runs is in a "managed" environment
like C#. Is it because Swing is thread safe?

TIA

Mar 7 '07 #1
4 986
<te***@cfl.rr.comwrote:
I've done some Java in the past. I don't remember ever having to worry
about updating a control from a thread other than the one that created
it. In C# you have to jump throught a bunch of hoops to with Invoke/
BeginInvoke or use tricks with BackgroundWorker. I don't remember
having to do this with Java. Java runs is in a "managed" environment
like C#. Is it because Swing is thread safe?
No, Swing has the same rules as Windows Forms. That's what the
SwingWorker class exists for. See
http://java.sun.com/docs/books/tutor...ncy/index.html

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Mar 7 '07 #2
PS

<te***@cfl.rr.comwrote in message
news:11**********************@p10g2000cwp.googlegr oups.com...
Hello,

I've done some Java in the past. I don't remember ever having to worry
about updating a control from a thread other than the one that created
it. In C# you have to jump throught a bunch of hoops to with Invoke/
BeginInvoke or use tricks with BackgroundWorker. I don't remember
having to do this with Java. Java runs is in a "managed" environment
like C#. Is it because Swing is thread safe?
A quick google shows that Swing is primarily not thread safe. You were
probably just lucky in the past that nothing went wrong.

http://groups.google.com/group/comp....3b1cd60d7e422b

PS
TIA

Mar 7 '07 #3
On Mar 8, 3:05 am, "PS" <ecneserpeg...@hotmail.comwrote:
<t...@cfl.rr.comwrote in message

news:11**********************@p10g2000cwp.googlegr oups.com...
Hello,
I've done some Java in the past. I don't remember ever having to worry
about updating a control from a thread other than the one that created
it. In C# you have to jump throught a bunch of hoops to with Invoke/
BeginInvoke or use tricks with BackgroundWorker. I don't remember
having to do this with Java. Java runs is in a "managed" environment
like C#. Is it because Swing is thread safe?

A quick google shows that Swing is primarily not thread safe. You were
probably just lucky in the past that nothing went wrong.

http://groups.google.com/group/comp....e_thread/threa...

PS
TIA
A reason why UI Components are not thread safe are because, any update
to UI components should not be blocked by a running thread as a block
on UI update would bring about a slow, non-responsive UI. This
violates the design goal of a Graphical User Interface.

Mar 8 '07 #4
PS wrote:
A quick google shows that Swing is primarily not thread safe. You were
probably just lucky in the past that nothing went wrong.
Similar to .NET 1.1, which does not check like 2.0 does.

Arne

Mar 15 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: roy | last post by:
The following is a simple example I wrote. I want function makenull() to set the arraylist null. However, in this example, after coming back from makenull() function, s is still not null. I got...
4
by: Robert | last post by:
Are visual basic.net and visual C#.net the same? which one is good to learn? How are they different from C++? Thank You
2
by: Alex | last post by:
Hello I am interested learn more about .NET but am uncertain of exactly what niche it fills in the world of programming. (The more I read the more I am confused). What I am looking for is the...
8
by: Kappa | last post by:
Hello I am familiar a little about programming. Infact I did C, then Java as part of my study at uni. I did touch it after that. Its been 3 years now but I want to start again. So should I go...
3
by: Tcs | last post by:
My backend is DB2 on our AS/400. While I do HAVE DB2 PE for my PC, I haven't loaded it yet. I'm still using MS Access. And no, I don't believe this is an Access question. (But who knows? I...
55
by: Steve Jorgensen | last post by:
In a recent thread, RKC (correctly, I believe), took issue with my use of multiple parameters in a Property Let procedure to pass dimensional arguments on the basis that, although it works, it's...
8
by: readytoride39 | last post by:
I am curious where does C# fit in regarding C and C++? Is it an extension of standard C with just a fancy name to take into account ..NET or is more than that? I am a C programmer so I am curious...
11
by: Bryan | last post by:
Hi, I work for a company that is heading towards an FDA approved development process. We have always used C++ in a windows environment, and we have more than 6 years of code, applications and...
6
by: Bri | last post by:
I've just started checking this out. I've got it to work alright with one exception. It is a secured MDE, so I've setup all the INI file options for it. The problem is that the UserID I setup for...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.