Results 1 to 9 of 9
Thread: the component does not show
- 07-08-2009, 07:36 AM #1
Member
- Join Date
- Jul 2009
- Posts
- 7
- Rep Power
- 0
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?
Java 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 07:40 AM.
- 07-08-2009, 08:07 AM #2
Senior Member
- Join Date
- Dec 2008
- Location
- Kolkata
- Posts
- 280
- Rep Power
- 5
You probably missed the setVisible method
Java 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);
- 07-08-2009, 08:22 AM #3
Member
- Join Date
- Jul 2009
- Posts
- 7
- Rep Power
- 0
NO,that is not the problem.It still doesn't show
- 07-08-2009, 08:30 AM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
What's myframe? Can you show the complete code here to see?
- 07-08-2009, 08:32 AM #5
Senior Member
- Join Date
- Dec 2008
- Location
- Kolkata
- Posts
- 280
- Rep Power
- 5
can you paste the complete code?
- 07-08-2009, 09:07 AM #6
Member
- Join Date
- Jul 2009
- Posts
- 7
- Rep Power
- 0
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 09:12 AM.
- 07-08-2009, 09:13 AM #7
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Interesting, since you write such a long code, didn't notice that error? Seems to me this is not yours' code.
- 07-08-2009, 09:16 AM #8
Member
- Join Date
- Jul 2009
- Posts
- 7
- Rep Power
- 0
no,that was enitrely written by me.
- 07-08-2009, 12:21 PM #9
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Similar Threads
-
Jbutton do not show up
By javaTech in forum AWT / SwingReplies: 15Last Post: 05-12-2009, 12:22 PM -
Cant get these lables to show up for some reaon. Can anyone help?
By wrestlingod302 in forum Java 2DReplies: 6Last Post: 04-07-2008, 03:57 AM -
How to Show Calendar
By praveen.kb in forum AWT / SwingReplies: 2Last Post: 02-09-2008, 08:23 AM -
netbeans 6.0 not show commpunent or show blank page
By fahimaamir in forum NetBeansReplies: 1Last Post: 01-26-2008, 06:20 AM -
show a RTF FORMAT
By Jack in forum Advanced JavaReplies: 2Last Post: 07-04-2007, 03:37 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks