• Post Reply Bookmark Topic Watch Topic
  • New Topic

default font of textArea  RSS feed

 
Tony Fabeets
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my toString() method used for textArea.append(object.toString()) has number formatting to line up each set of outputs. System.out.println(object) spits out the formatted output just fine. when i use textArea.append(...) the formatting is barely there. Not sure how to fix this.
second question: when the user clicks JMenuItem "exit" a 2nd frame pops up asking "Are you sure?" and 2 buttons, yes and no. how would i go about freezing focus on the 2nd frame, so nothing can be done to the main frame when the 2nd frame is present?
[ December 29, 2003: Message edited by: Tony Fabeets ]
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For the first question, I'm not that sure what u meant... If we are printing out the string of the object itself, we will get the object itself, not the value contained in it... So if you print like "textArea.append(object)", it will append the object itself, not the value contained in it...
For the second question, u can make it "parentFrame.setEnabled(false)" so that your parentFrame will be disabled. After you clicked on the buttons on the child dialog, u have to set the "parentFrame.setEnabled(true)" again...
Hope it is helpful...
 
Tony Fabeets
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for the second ?, exactly what i was looking for
for the first: my toString() method overrides the toString() provided by java, so when i call toString() it formats each var as i want, justification and all. The ? is, is there a way to get textArea to print chars in the same way that System.out.println(object.toString()) does? As of now, when trying to textArea.append(object.toString()), it formats, but is losing accuracy in the translation of my toString() method.
*edit i changed the font to Courier. that answered ? 1.
new question: what is the default font of textArea?
[ December 29, 2003: Message edited by: Tony Fabeets ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!