• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Harry Geri
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Campbell Ritchie
Sheriff
Posts: 55351
157
  • Mark post as helpful
  • send pies
  • 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
  • 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
Sheriff
Posts: 55351
157
  • Mark post as helpful
  • send pies
  • 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
  • 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
Sheriff
Posts: 55351
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try ctrl‑A→ctrl‑I on Eclipse; that may correct your indentation.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!