Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

Java GUI repaint problem

Thread view: 
Dustin - 28 Jan 2006 00:10 GMT
I made a java GUI app that shrinks and then uploads images via FTP to a
server.  It works great on using both of my computers which are both
running JRE 1.5+, but when I run it on two other computers (that have
JRE 1.4.x) the GUI won't refresh.

Usually this problem is caused becuase the processing is taking place
in the GUI thread or EDT, but I am not doing that.  I have a different
thread doing my processing, so I am not sure what is going on.

I haven't pasted my code becase there is a lot of it, but here is what
specifically causes the problem.  I have a JList which stores a list of
file names.  The user can click a button and choose one or more files
to add to this list.  When they click OK or whatever,  the new file
names are added to the JList by doing
    list.setListData(imageArrayList.toArray());
and then validating the main panel which all of the gui components
reside.

If the user chooses Cancel instead of OK when choosing more files, this
problem does not happen.  They have to choose files and click OK to
cause the problem.  Does anyone have any general ideas of what could be
going wrong?
Douwe - 28 Jan 2006 00:51 GMT
Swing does NOT support multi-threading so what you could try is putting
the data in the JList inside the Swing-Thread using the method
SwingUtilities.invokeLater(Runnable)

Apparently the 1.5 JRE does handle this better as the JRE 1.4
environment

I hope this helps ...
hiwa - 28 Jan 2006 00:52 GMT
Post a small demo code that is generally compilable, runnable and
could reproduce your problem. See:
http://homepage1.nifty.com/algafield/sscce.html


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.