Results 1 to 5 of 5
  1. #1
    SNPTT is offline Member
    Join Date
    May 2010
    Posts
    9
    Rep Power
    0

    Default Can you create two GUIs?

    Hey
    ive been recently creating a utility which is an interactive map. My problem is i have a window for the interactive map and a window for a distance tool, however, my distance tool (including JCombo Boxes and JLabels) are appearing on both windows, how do i make it so it only appears on one? I though maybe you create two GUIs for the windows?

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,304
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by SNPTT View Post
    Hey
    ive been recently creating a utility which is an interactive map. My problem is i have a window for the interactive map and a window for a distance tool, however, my distance tool (including JCombo Boxes and JLabels) are appearing on both windows, how do i make it so it only appears on one? I though maybe you create two GUIs for the windows?
    Maybe an JInternalFrame can be of any help?

    kind regards,

    Jos

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,251
    Rep Power
    25

    Default

    What do you mean by GUIs? Are you using the JFrame class to create windows?
    How are you adding the components to the windows? Is there a common component that you are adding to both windows?

    Not sure what you mean by saying the tools are appearing on both windows.

  4. #4
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,233
    Rep Power
    6

    Default

    Actually a component can only have a single parent. So if a component is appearing on two frames it is because you are creating two components and add each component to a different frame. Don't do this and you won't have a problem.

  5. #5
    SNPTT is offline Member
    Join Date
    May 2010
    Posts
    9
    Rep Power
    0

    Wink

    Quote Originally Posted by Norm View Post
    What do you mean by GUIs? Are you using the JFrame class to create windows?
    How are you adding the components to the windows? Is there a common component that you are adding to both windows?

    Not sure what you mean by saying the tools are appearing on both windows.
    Quote Originally Posted by camickr View Post
    Actually a component can only have a single parent. So if a component is appearing on two frames it is because you are creating two components and add each component to a different frame. Don't do this and you won't have a problem.
    Quote Originally Posted by JosAH View Post
    Maybe an JInternalFrame can be of any help?

    kind regards,

    Jos
    Hey guys, Thanks for answering :). In the end i created another class and ran them parallel using a JButton, i think :/ well whatever it was it seemed to work (Y)

Similar Threads

  1. guis and php
    By paddala in forum Advanced Java
    Replies: 1
    Last Post: 02-18-2010, 02:43 AM
  2. How to create the Jvm using JDK?
    By Sungron in forum New To Java
    Replies: 4
    Last Post: 02-01-2010, 10:50 AM
  3. to create Web Application
    By bhangale.parag in forum Web Frameworks
    Replies: 0
    Last Post: 12-17-2008, 01:38 PM
  4. How to create a sash in SWT
    By Java Tip in forum SWT
    Replies: 0
    Last Post: 07-02-2008, 08:04 PM
  5. Create XML From XSD
    By Jack in forum XML
    Replies: 1
    Last Post: 07-09-2007, 12:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •