Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JLabel and JTextArea do not show properly in ubuntu  RSS feed

 
Kharon Ice
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok here's the problem. I have a frame to which I add two labels, two text areas and two buttons in a SpringLayout. Although the frame shows perfectly in Windows7, Ubuntu only shows a very small (maybe 5 pixels wide and 20 pixels tall) textbox, without any labels at all. Of course I should mention that the text for the labels is being added in another method. Here's the code:



And of course a sample of the methods that change the text in the label



The buttons show just fin on the frame, it's the pesky labels and text areas that misbehave.
 
Kharon Ice
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No one?
 
James Sabre
Ranch Hand
Posts: 781
Java Netbeans IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kharon Ice wrote:No one?


The basic problem people will have is that you have posted only a small portion of your code and they have no way of testing your code. On top of this you have made the assumption that the problem is somewhere in the fragment of code you have published but since you don't understand the problem yourself you can't be sure it is.

When I have a problem like this I create an SSCCE which exhibits the problem. Usually in creating the SSCCE I find the source of the problem but if I don't then I can post the SSCCE here and get others to run it.
 
Kharon Ice
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fixed using some good old elbow grease. The problem was that the labels and text areas were Label and TextArea instead of JLabel and JTextArea. Apparently ubuntu hates awt
 
James Sabre
Ranch Hand
Posts: 781
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well done but read http://java.sun.com/products/jfc/tsc/articles/mixing/
 
Kharon Ice
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much for the link, it was very helpful
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!