?
Solved

Problem with JFrames

Posted on 2003-02-24
7
Medium Priority
?
187 Views
Last Modified: 2010-03-31
I made an application. In this application I have an Jframe that shows all customers in a table. When the users double clicks an customer the program opens a new JFrame with the customer details.

My problem is that the first JFrame stays accessible. How to solve????

0
Comment
Question by:RdeLange
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
7 Comments
 
LVL 18

Expert Comment

by:bobbit31
ID: 8010924
make the frame with the customer details a modal JDialog:

from your initial form:
CustomerInfoDialog cid = new CustomerInfoDialog(this, "Customer Info", true);
cid.show();


public class CustomerInfoDialog extends JDialog {
   public CustomerInfoDialog(Frame owner, String title, boolean modal) {
        super(owner, title, modal);

        // add your components
   }
}

}

0
 

Author Comment

by:RdeLange
ID: 8010961
Why using a dialog? Isn't a JFrame better? Because the user has to fill in a lots of fields.

0
 
LVL 18

Expert Comment

by:bobbit31
ID: 8011031
you can put whatever components you want on a JDialog.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 18

Expert Comment

by:bobbit31
ID: 8011043
another thing you might want to try is:

when opening second frame call
parentFrame.disable();

when closing second frame:
parentFrame.enable();
0
 
LVL 18

Expert Comment

by:bobbit31
ID: 8011053
oops, make that:
parentFrame.setEnabled(false);
and
parentFrame.setEnabled(true);
0
 

Author Comment

by:RdeLange
ID: 8012248
Yes, thats seems logic to me. I tried this but I see that my data on the first screen doesn't contain the updated data from the second screen.

How can I update that data?
0
 
LVL 18

Accepted Solution

by:
bobbit31 earned 150 total points
ID: 8012626
set it back to enabled before updating
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month14 days, 16 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question