• 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

I cannot figure out how to put on JFrame reverse the txt file put on text area and write on other

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welocome to the Ranch

You do not reverse the text in a text component. You should not do anything like that in your Swing app. You should have a StringReverser class, or Reverser, with a method that reverses the String passed to it. I shall give you a start You get the text from somewhere and pass it to that method. Then you can use the returned text elsewhere.

That method gets all the information it uses from the arguments, and only returns information via its return type, so it is a 1368 in the dreaded Campbell Ritchie classification of methods. If you find 1368 you will find it is possible to make it static.

Don't use String Tokenizer. It went out of use as a legacy class nearly 15 years ago.
 
Harry Geri
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is my full code so far.Button need to compare show in the status section it is identical or not.Reverse should be show in the textArea2 and write on text2.txt.Convert should be deque uppercase show in the textArea1 or textArea2.Am I trying the stuff too complicated.C++ was more simple for me.Java have a lot of errors.I swear I am losing my hair already.
 
Campbell Ritchie
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looks to me as though you are trying too much all at once. How many lines did you write before compiling? Which text editor are you using?
 
Harry Geri
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using mac text editor and Java editor Eclipse Mars.I try to patch first code on my recent code did not work.
 
Campbell Ritchie
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try ctrl‑A→ctrl‑I on Eclipse; that may correct your indentation.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic