Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-08-2009, 08:36 AM
Member
 
Join Date: Jul 2009
Posts: 7
Rep Power: 0
shruti is on a distinguished road
Default the component does not show
i need to see two components at the same time and embed one on other.the size of the to be placed component has been reduced so that it fits in the centre of other component.But eaxh time i try doing it i do not see the placed component.please help me.is there a problem with the layout managers?

Code:
JPanel mainpanel=new JPanel();
	final JPanel main = new JPanel(new BorderLayout());
        final JPanel optionsPanel = new JPanel();
 	cirarc12 c2=new cirarc12();
	c2.setPreferredSize(new java.awt.Dimension(100,100));
	optionsPanel.add(c2,BorderLayout.CENTER);
	main.add(chartPanel, BorderLayout.NORTH);
        //main.add(c2,BorderLayout.CENTER);
     	mainpanel.add(main,BorderLayout.CENTER);
	mainpanel.add(optionsPanel,BorderLayout.CENTER);
	myframe.add(mainpanel);
	myframe.pack();

Last edited by shruti; 07-08-2009 at 08:40 AM.
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 07-08-2009, 09:07 AM
Senior Member
 
Join Date: Dec 2008
Posts: 164
Rep Power: 2
dswastik is on a distinguished road
Default
You probably missed the setVisible method

Code:
JPanel mainpanel=new JPanel();
	final JPanel main = new JPanel(new BorderLayout());
        final JPanel optionsPanel = new JPanel();
 	cirarc12 c2=new cirarc12();
	c2.setPreferredSize(new java.awt.Dimension(100,100));
	optionsPanel.add(c2,BorderLayout.CENTER);
	main.add(chartPanel, BorderLayout.NORTH);
        //main.add(c2,BorderLayout.CENTER);
     	mainpanel.add(main,BorderLayout.CENTER);
	mainpanel.add(optionsPanel,BorderLayout.CENTER);
	myframe.add(mainpanel);
	myframe.pack();
        //following line missing in your code
        myframe.setVisible(true);
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 07-08-2009, 09:22 AM
Member
 
Join Date: Jul 2009
Posts: 7
Rep Power: 0
shruti is on a distinguished road
Default
NO,that is not the problem.It still doesn't show
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 07-08-2009, 09:30 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,504
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
What's myframe? Can you show the complete code here to see?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 07-08-2009, 09:32 AM
Senior Member
 
Join Date: Dec 2008
Posts: 164
Rep Power: 2
dswastik is on a distinguished road
Default
can you paste the complete code?
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 07-08-2009, 10:07 AM
Member
 
Join Date: Jul 2009
Posts: 7
Rep Power: 0
shruti is on a distinguished road
Default
it is a huge code.it has a lot of file handling elements in it as it takes input from two files.this is the major problem i'm facing that the cirarc12 component does not appear in the middle of the chart.

what might be the problem?

Last edited by shruti; 07-08-2009 at 10:12 AM.
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 07-08-2009, 10:13 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,504
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
Interesting, since you write such a long code, didn't notice that error? Seems to me this is not yours' code.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 07-08-2009, 10:16 AM
Member
 
Join Date: Jul 2009
Posts: 7
Rep Power: 0
shruti is on a distinguished road
Default
no,that was enitrely written by me.
Bookmark Post in Technorati
Reply With Quote
  #9 (permalink)  
Old 07-08-2009, 01:21 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,504
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
Originally Posted by shruti View Post
no,that was enitrely written by me.

hmmm, anyway, can you post the code segment that the panel initiate and added the component into it. Without knowing what you exactly do, really difficult to comment.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Jbutton do not show up javaTech AWT / Swing 15 05-12-2009 01:22 PM
Cant get these lables to show up for some reaon. Can anyone help? wrestlingod302 Java 2D 6 04-07-2008 04:57 AM
How to Show Calendar praveen.kb AWT / Swing 2 02-09-2008 09:23 AM
netbeans 6.0 not show commpunent or show blank page fahimaamir NetBeans 1 01-26-2008 07:20 AM
show a RTF FORMAT Jack Advanced Java 2 07-04-2007 04:37 AM


All times are GMT +2. The time now is 11:11 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org