On January 27th, this site will be read-only as we migrate to Oracle Forums for an improved community experience. You will not be able to initiate activity until January 30th, when you will be able to use this site as normal.

    Forum Stats

  • 3,889,585 Users
  • 2,269,760 Discussions
  • 7,916,785 Comments

Discussions

Opening Internal Frames

843807
843807 Member Posts: 46,582
edited Oct 28, 2002 6:27AM in Java Desktop Applications
I am currently developing hotel reservation software and using the JDesktopPane to manage all of my JInternalFrames. Each of the JInternalFrames opens correctly when I select them from the menu in JMainFrame, but what I want to do is to open my JInternalFrameCustomers from my JInternalFrameBookings using a JButton. The reason for this is that I could not fit all the information on the one screen and I need to save information from both internalFrames to the database in the one object. Can some one please tell me how to do this (Open the JinternalFrame from a JInternalFrame), I would very much appreciate it.
My code is as follows:


void jButtonBook_actionPerformed(ActionEvent event) {

JDesktopPane theDeskTop = new JDesktopPane();
DesktopManager thisDesktopManager;
try{
JInternalFrameCustomers frameCustomer = new JInternalFrameCustomers();
JInternalFrameBookings frameBookings = new JInternalFrameBookings();
theDeskTop = frameBookings.getDesktopPane();
thisDesktopManager = theDeskTop.getDesktopManager();
thisDesktopManager.openFrame(frameCustomer);
frameCustomer.setOpaque(true);
frameCustomer.setVisible(true);
frameCustomer.setSize(thisDeskTop.getSize());
theDeskTop.add(frameCustomer);
frameCustomer.moveToFront();
frameCustomer.requestFocus();
}
catch(Exception e){
}
}
thanks heaps

Comments

  • 843807
    843807 Member Posts: 46,582
    I am not sure I have understood your question properly.

    You have said you want to open CustomerFrame from BookingFrame.But you have written it in buttonbook action.So does this mean already BookingFrame is visible and has been added to a DeskTopPane?
    If so why do you create another BookingFrame inside this?
    Also if you already have a DesktopPane you should create a CustomerFrame and try and add it to that DesktopPane(you can make that DeskTopPane static so as to access).

    Hope this helps.If you feel I have misunderstood the question,or I am wrong, please ignore this.

    Ranga.
  • 843807
    843807 Member Posts: 46,582
    Thanks Ranga,
    I have got it to work. :)
    byeee
This discussion has been closed.