• Post Reply Bookmark Topic Watch Topic
  • New Topic

g.drawString() problem  RSS feed

 
Gabor Beke
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hy guys!

I need a little assist on this because I cant really figure it out what I'm doing wrong. I'm working on an envelope writing program. The program have 4 JTextField.
Name, City, Addres, Postal Code. I use keylistener on Name JTextField to recognize the Enter button, and add a new Name JTextField. (Basicly, it sets the 2nd Name JTextField Visible). So total you could have 4 Name JTextField and the others (city, address, postal code) total 7. Also has print jbutton, jtable for viewing already written envelopes waiting for printing so on. When I use g.drawString() I use a predefined x,y value which are changing dynamicly according to the Names field's text length measured by Font Metrics' StringWidth() method and calculating with the right side margin value.. whatever. My Main problem is here:



Can you tell me what I did wrong? I dont think this should be very complicated, I must missing something little.

Thanks in advance
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gabor Beke wrote:My Main problem is here:

Actually, your main problem is in what you posted,

Please DontWriteLongLines. It makes your thread very hard to read. I've broken yours up this time as best I can, but for future reference, please remember:
80 characters max.
And that includes string literals AND comments.

Also: your indentation is all over the place. You might want to fix that yourself with the 'Edit' key.

Thanks.

Winston
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!