• Post Reply Bookmark Topic Watch Topic
  • New Topic

How do I make a text appear from the right in JTextWindow ?  RSS feed

 
Kristian Andersson
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a little project on my spare time, featuring the developing of a simple and memory-insufficient calculator. In Java, of course.
Anyway, as the name of the thread suggests I want the numbers to appear from the right in the textfield of the calculator. The textfield that I use is, as the name of the thread also suggests, a "JTextWindow" (if this has any importance whatsoever). I don't see why posting my code should be necessary so far, so I won't do it for now.
Oh. And I guess I could use a StringBuffer to move the contents around each time the user inputs a new number into the calculator, but I was kind of hoping there was an easier way around, a method that does the job for me, or something like it.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the Swing forum...
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ahhh, the API is a wonderful thing.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!