Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

JComponent

  • 30-04-2003 12:50PM
    #1
    Closed Accounts Posts: 1,718 ✭✭✭


    I have a problem with a JComponent object. basically i have a JComponent object already created & i need to put a couple of JPanels into the GUI beside it. dont know if im explaining myself very well here.

    right what im asking is : id there a parent that will take both JComponent and JPanel or do i need to change the JComponent to something else to make it work. ive already tried changing it to JFrame, MainFrame etc but nothing seems to work.

    i tryed using a JSplitPane but that dosent seem to want to take the JComponent. i was thinking of JRootPane or something similar


Comments

  • Closed Accounts Posts: 679 ✭✭✭ciano


    Im not really sure what you mean here. Can you clarify it a bit?
    is there a parent that will take both JComponent and JPanel

    Well JPanel extends JComponent, so Im a bit confused as to what you mean.

    You could put your JComponent and your two JPanels in a JFrame, or even another JPanel.


  • Closed Accounts Posts: 358 ✭✭CH


    have a look at suns tutorials


  • Closed Accounts Posts: 1,651 ✭✭✭Enygma


    I often use http://www.javaalmanac.com for this type of question. It's got thousands of little code snippets.


  • Closed Accounts Posts: 1,718 ✭✭✭whosurpaddy


    thanks for the replies lads. turned out the prob was i wasnt laying the new panels out properly using NORTH, SOUTH etc. i was convinced i had the wrong container object. sorry if i confused anyone;)


Advertisement