• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Swing input from a textarea

 
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
exp.JPG
[Thumbnail for exp.JPG]
 
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Seriously? That's what you're going with? I prefer this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic