This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Swing input from a textarea Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Swing input from a textarea" Watch "Swing input from a textarea" New topic
Author

Swing input from a textarea

Rakesh Keerthi
Ranch Hand

Joined: Jul 16, 2012
Posts: 136
Actually I have the below cases :

Case1 : "the collection was guaranteed.i'm sure it is"
Case2 : the collection was guaranteed.i'm sure it is
Case2 : the collection was guaranteed...i'm sure it isThese cases i want to reflect using a swing window.Which will accept these cases.


Conditions :

In case1 , since the text is surrounded by "" it should not do anything.

second case, since the data is not surrounded by "", the "." should be highlighted (if the "." is single) in yellow.

In 3rd case sine the "." is preceded or followed by another "." it should be left as it is.

i've tried the below swing code.




this code works fine,but, the problem is that the input is taken in the console and the output is shown in a swing window. and i want input to be in a textarea, a button, and clicking it the output should be displayed in second textarea. please refer the below screenshot for reference.

please help me doing this.

Thanks


[Thumbnail for exp.JPG]

Tony Docherty
Bartender

Joined: Aug 07, 2007
Posts: 2175
    
  47
You need to add the missing GUI components and remove the scanner code.
You will also need to add an ActionListener to the button to get the text from the first text area, process it and display it in the second text area.
 
Don't get me started about those stupid light bulbs.
 
subject: Swing input from a textarea
 
Similar Threads
Populating JList in Parent window from Child window's save button
How to set the text in JTextarea from bottom.
GUI troubles
Repetetively Append to JTextArea?
Why is this code taking too long to launch