Posts Tagged ‘Swing Components’

Java Programming:Threads and Swing Components?

Saturday, September 27th, 2008
java programming
Bishnu B asked:

I have to work in threads and swing.
I have a class that has some frame components like textarea,textfield and so on.When the button from the frame is clicked, a new working thread is created which reads the input from the InputStream.Now I want to display the read data to the textarea of the frame.How can I do this any idea?I have tried but the message is only printed on the standard output and not displayed on the textarea.

In java, How can I display the contents of a text file in a textarea using the open dialog box?

Friday, August 15th, 2008
java
hilan asked:

Using swing components I created a text area and a butten named ‘open’. When I click the ‘open’ button an opendialog box should appear and thus I can select a text file. How can I display the contents of the file into the text area? Can it be done only with the concept of files only? If you know please wite the source code.