Why wouldn't a label show when you remove the layout manager and use setBounds() to position and size it. Are you sure the size is correct? Print out its width and height to make sure.
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Why wouldn't a label show when you remove the layout manager and use setBounds() to position and size it. Are you sure the size is correct? Print out its width and height to make sure.
If you don't understand my answer, don't ignore it, ask a question.
You print out the values of things to see if they are what you expect them to be. If the values are different, then your assumptions about how the program is working are probably wrong.Please why?
If you don't understand my answer, don't ignore it, ask a question.
hmmm ... You mean removing the layout and working with X and Y on setBounds ??
I tried it but it seems I'm making something wrong too... .??
You will have to explain.
If you don't understand my answer, don't ignore it, ask a question.
I am sorry I could not get it .. even my teacher said i have never used it ... so please if you could give hint or explanation I really appreciate that ..
Did you print out the sizes of the labels as I suggested in post#26?
You use the labels values in the setBounds() call. What are they?
If you don't understand my answer, don't ignore it, ask a question.
honestly I couldn't think anymore .. I fix it every single problem im my program except this point .. please hint or so ..
Did you print out the sizes of the labels: logo and picture as I suggested in post#26?
You use the labels' values in the setBounds() call. What are they?
logo.setBounds(600, 100, logo.getWidth(), logo.getHeight());
What are the values in red?
Last edited by Norm; April 23rd, 2012 at 06:25 PM.
If you don't understand my answer, don't ignore it, ask a question.
the height and width of the size of the picture.
the logo and picture are same sizes width and height ... 140, 166
You are assuming you know something. To be sure, you need to Print out the values before they are used.
Re-read post #34
If you don't understand my answer, don't ignore it, ask a question.
I am sorry from asking this but did you test my code and fix the code ?
because I tried everything in the layout maneger also i changed everything in setBounds ... I also finish that wile ago except this thing which makes it weird that my code is same as the tutorial... so i have no idea why it is not working well
I am trying to have you debug your program so you can see what the problem is.
Have you printed out the values I have been talking about so you can see the problem?
Print out the values that are shown in red in post #34.
Post the all the changes you made to the setBounds() calls. If you really had changed everything there, the images in the labels would have shown.i changed everything in setBounds
If you don't understand my answer, don't ignore it, ask a question.
I will post all th changes that I've made in my codes but Plz test it and check my problem .. Cuz I worked with a grad student and we tried but he said everything seems good that must work .. So if u really know the problem Plz tell me .. Cuz the bounds is good and I wrote it exactly like every single example that I've seen in google..
I do NOT understand why you refuse to do what I have been recommending for many posts.
Please explain why you will not do the following:
Have you printed out the values I have been talking about so you can see the problem?
Print out the values that are shown in red in post #34.
I wait to see what is printed out.
Famous last words. I think the captain of the Titanic said something like that.everything seems good that must work
Last edited by Norm; April 27th, 2012 at 07:18 PM.
If you don't understand my answer, don't ignore it, ask a question.