Results 1 to 3 of 3

Thread: Help in JFrame

  1. #1
    kirtesh4u is offline Member
    Join Date
    Nov 2008
    Posts
    7
    Rep Power
    0

    Default Help in JFrame

    hi all
    I have Created one Frame and in which Buttons are provided which opens new Internal Frames....what i want is when i open one Internal Frame the other Internal Frame gets closed...
    or

    if i click one button then other button gets disabled and when i close the internal frame all disabled button gets enabled...


    please help me out....
    thank you...

  2. #2
    jmorris is offline Member
    Join Date
    Nov 2008
    Posts
    12
    Rep Power
    0

    Default

    try this in your frames


    public class MainFrame extends JFrame implements ActionListener
    {
    ...

    public static void main(String[] args) {
    MainFrame mainWindow = new MainFrame();
    }

    public MainFrame() {

    ...

    ...

    public void actionPerformed(...) {

    Object o = e.getSource();
    if ( o == newWindowButton) {
    newWindow sub = new newWindow(this);
    this.setVisible(false);
    }





    for your second window...

    public newWindow(Frame p) {

    parent = p;


    ....
    ...
    ...

    public void actionPerformed(...) {


    ....
    ...
    if (o == closeButton) {
    parent.setVisible(true); //to show previous window
    this.dispose();

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

Similar Threads

  1. how to use JFrame in JSP ??
    By priyanka sharma in forum JavaServer Pages (JSP) and JSTL
    Replies: 8
    Last Post: 04-06-2011, 04:51 AM
  2. JFrame ??
    By sweet angle in forum AWT / Swing
    Replies: 15
    Last Post: 11-06-2008, 04:25 PM
  3. jframe
    By amith in forum AWT / Swing
    Replies: 1
    Last Post: 05-15-2008, 10:03 AM
  4. JFrame problem
    By saytri in forum New To Java
    Replies: 6
    Last Post: 01-11-2008, 05:12 PM
  5. Help with JFrame
    By Albert in forum AWT / Swing
    Replies: 2
    Last Post: 07-04-2007, 04:44 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
  •