Forums.Sureshkumar.net : A Perfect Place to Share Knowledge         Blogs     Games    Magazines    

"Sharing knowledge does not lessen your store, often it gets you more. Sharing plays a key role in relationships and bonding, happens in small steps and is assisted through community membership."

Go Back   SURESHKUMAR.NET FORUMS > TECHNICAL DISCUSSIONS > JAVA Technologies
Register FAQ Members List Calendar Games Blogs Search Today's Posts Mark Forums Read

   

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old 24-11-06, 12:44 PM   #1 (permalink)
Junior Member
 
Join Date: Nov 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 3 padmanabhanp is on a distinguished road
How to add the components in panel

Hai
Can anyone help me how to add the components in panel using setBounds.
padmanabhanp is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 24-11-06, 01:55 PM   #2 (permalink)
Moderator
 
t_mohan's Avatar
 
Join Date: Apr 2006
Location: India
Posts: 636
Thanks: 57
Thanked 78 Times in 63 Posts
Thanks: 57
Thanked 78 Times in 63 Posts
Rep Power: 17 t_mohan is a splendid one to behold t_mohan is a splendid one to behold t_mohan is a splendid one to behold t_mohan is a splendid one to behold t_mohan is a splendid one to behold t_mohan is a splendid one to behold t_mohan is a splendid one to behold
Re: How to add the components in panel

Hi Padmanabhan,

Please correct me if im wrong, coz im not that much well versed with AWT.

You can add a component to a panel , In the panel you can set where the component should be displayed.
like JPanel p = new JPanel(new BorderLayout());

When you add components to a panel, you use the add method. Exactly which arguments you specify to the add method depend on which layout manager the panel uses. When the layout manager is FlowLayout, BoxLayout, GridLayout, or SpringLayout, you shud typically use the one-argument add method, like this

componentX.setBounds(10,10,300,400);
p.add(componentX);

Please let me know your questions and also im wrong

Thank You,
Mohan.T
__________________
M0h@n
t_mohan is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 24-11-06, 02:13 PM   #3 (permalink)
Super Moderator
 
sk_kireeti's Avatar
 
Join Date: Feb 2006
Location: Hyderabad
Posts: 2,355
Thanks: 117
Thanked 241 Times in 198 Posts
Thanks: 117
Thanked 241 Times in 198 Posts
Blog Entries: 4
Rep Power: 51 sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute sk_kireeti has a reputation beyond repute
Re: How to add the components in panel

Padmanabhanp,

What Mohan said it true. But when I am using setBounds(....) method, I prefer to use "null" layout for better flexibility.

Panel p = new Panel();
p.setLayout(null);
.
.
.

remaining program will be same as said by Mohan.

Thanks,
Krishna
sk_kireeti is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
j2ee interview Q & A jasmine84 JAVA Technologies 4 23-01-07 02:09 AM
Java Contest-13 with answers keerthi JAVA Technologies 8 31-12-06 09:44 AM
9 Important Bold Tips to face Panel ( By Unknown ) AjayKumar.Kataram HR Questions 1 26-09-06 09:28 PM
Important Components of an Offer Letter AjayKumar.Kataram Inspire yourself & Others - Leaders Zone 1 22-09-06 09:24 PM
quick time overview abeetha.m OTHERS 0 09-07-06 12:35 PM


All times are GMT +6.5. The time now is 10:28 AM.





Search Engine Optimization by vBSEO 3.1.0