| Author |
problem with the code
|
in.anurag Singh
Greenhorn
Joined: May 14, 2010
Posts: 25
|
|
I have a problem with the above code.
The program is compiling successfully and is running but i am not getting the panel containing rectangle on the main Frame.
The main Frame is displaying only the comboboxes, there should be a rectangle also..
Please solve the problem..
|
 |
Jhedzkie Skies
Ranch Hand
Joined: Oct 28, 2009
Posts: 118
|
|
please use codetags next time.
|
 |
in.anurag Singh
Greenhorn
Joined: May 14, 2010
Posts: 25
|
|
oh..yes..
i will take care of that..this is my first time to have the problem with the code so sorry..
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8430
|
|
You can use the button to incorporate the code tags in your original post
|
[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
|
 |
pete stein
Bartender
Joined: Feb 23, 2007
Posts: 1561
|
|
Your drawrectangle class as shown:
attempts to draw a 150 x 100 point rectangle with the rectangle's top left corner at [200, 50]. However when you create one in your main class:
you only give it a size of 150 x 50, so how will this rectangle ever show if it starts at 200, 50?
Also, you avoid using null layout and setBounds but instead let layout managers do the component laying for you.
|
 |
in.anurag Singh
Greenhorn
Joined: May 14, 2010
Posts: 25
|
|
Thanks,
This makes my code run and a rectangle is now appearing..
Thanks a lot..
I will now try this by layout managers..
|
 |
 |
|
|
subject: problem with the code
|
|
|