• Post Reply Bookmark Topic Watch Topic
  • New Topic

placing label with the given coordinates

 
Johny Wyenski
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have posted this question on the other forum but there is no answer from them and it is not in English language after all.

I can create textfield but with ordinary label I have difficulties:



For textfield I needed:



I do in analogical way with label but it does not want to appear at all. I was also looking for (http://docs.oracle.com/javase/7/docs/api/javax/swing/JLabel.html#JLabel%28java.lang.String,%20int%29) how to place label in the given place (by its coordinates x and y) but I can see only constants like LEFT, CENTER, RIGHT, LEADING or TRAILING.

Regards!
 
mike ryan
Ranch Hand
Posts: 210
Eclipse IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

in reply to your JLabel not showing up,

You have to add it to something. maybe using getContentPane() or creating a JPanel and add it to that.
 
Johny Wyenski
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, it helps, thanks. I use it:



And text fields were explained here: http://www.coderanch.com/t/563704/java/java/text-field-new-window#2559274 (in case somebody searching for similar problem finds this thread).

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