Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

list of component not displayed

 
mark smith
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

in a class who extends a JPanell, i have a list of JLabe
this class is added to a JFramel
the jframe is displayed but not the jlabel



in the constructor of the class i have



any idea?

thanks
 
Darryl Burke
Bartender
Posts: 5126
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Insufficient information. Without knowing to what Container class you are adding the JLabels, and what Layout Manager that container has, I wouldn't want to guess at the reason.
 
mark smith
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Darryl Burke wrote:Insufficient information. Without knowing to chat Container class you are adding the JLabels, and what Layout Manager that container has, I wouldn't want toguess at the reason.


like i wrote, the container class is a JPanel

 
Rob Camick
Ranch Hand
Posts: 2580
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are not mind readers. You still have not provided enough information.

Post your SSCCE that demonstrates the problem.
 
mark smith
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
all the code



other class

 
Rob Camick
Ranch Hand
Posts: 2580
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you add any debug code to make sure the loop is being executed?
 
mark smith
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
initialization problem.....

lblJournee size is 0.... so the loop is not executed......

 
Rob Spoor
Sheriff
Pie
Posts: 20527
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which makes sense since you loop to the size of your List, not the size of your array. And at that time, the List is of course still empty.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic