How to make a frame modal?

Hei guyz,
I'm trying to call a frame from another frame (which should basically act like a dialog, but is not a dialog), how can i make this 'child' frame modal, i.e. once im done with the 'child' frame, the focus has to go back to the 'parent' frame and no other component could be opened while a user is working on the 'child' frame.
Can anyone let me know, how this is possible and is there any other better approach (other than making the child frame, a dialog)?
Thanks in advance.

and is there any other better approach How can we suggest a better approach when we don't know why you rejected a modal dialog.
Based on your requirement:
once im done with the 'child' frame, the focus has to go back to the 'parent' frame and no other component could be opened while a user is working on the 'child' frame.
it would appear to me that using an modal dialog is the obvious choice.
Otherwise I suggest you search the forum. Keywords like "modal jframe" would be a good place to start.

Similar Messages

  • How to make the frame of the inputfield colored?

    Hi everyone,
      I have a problem here: I have a table on the screen, there are two columns which are inputfield,when user type something and press the "Enter" button,  my program will check whether the value is correct or not. And when the input is wrong I want to point out the specific cell which is wrong by make the frame of the cell red, green or something else.
      How can I achieve this?
    Thanks in advance.

    hi,
    check out this thread :
    Re: Can we Change the backround color of an Input field in Webdynpro for ABAP.
    Thanx.

  • How to make a Frame transparent?

    Hi everyone:
    I want to make a Frame transparent,it is possible?I find all the API but no result : (
    More, I want to increate my Frame's Height ,but it can't work. code is:
    Frame f=new Frame("Test");
    for(int i=0;i<6;i++){
    f.setSize(40,i * 10);
    }If I change to code to
    f.setSize(40,10);
    f.setSize(40,20);
    f.setSize(40,30);
    ...................It can work well.But why ? It is so complicated . : (
    Please help me

    More
    How to add a hyperlink Text in Frame? When I click it which can open a web site?

  • Who knows how to make the frame open broader from the very beginning

    Hello people,
    now my code is working correctly, but the only problem, every time i start the progrm the window is minimum and each time i need to mke it full opened, How to do this?
    Thank you in advance
    Galina
    Here is my code:import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.lang.*;
    public class AnimatorApplicationTimer extends JFrame implements ActionListener
    int frameNumber=-1;
    Timer timer;
    boolean frozen=false;
    JLabel label;
    ImageIcon icon;
    AnimatorApplicationTimer(int fps, String windowTitle){
    super(windowTitle);
    int delay=(fps>0) ? (1000/fps):2000;
    timer=new Timer(delay, this);
    timer.setInitialDelay(0);
    timer.setCoalesce(true);
    addWindowListener(new WindowAdapter()
    public void windowClosing(WindowEvent e){
    System.exit(0);
    label=new JLabel("Frame ", JLabel.CENTER);
    //icon=new ImageIcon[2];
    //label.setIcon(icon);
    label.addMouseListener(new MouseAdapter(){
    public void mousePressed(MouseEvent e){
    if(frozen) {
    frozen=false;
    startAnimation();
    else {
    frozen=true;
    stopAnimation();
    getContentPane().add(label, BorderLayout.CENTER);
    public void startAnimation(){
    if(frozen) {
    else {
    if(!timer.isRunning()) {
    timer.start();
    public void stopAnimation() {
    if(timer.isRunning()) {
    timer.stop();
    public void actionPerformed(ActionEvent e)
    frameNumber++;
    if(frameNumber<3) icon= new ImageIcon("H:/newJava/bin/T"+frameNumber+".jpeg");
    else
    icon=new ImageIcon("H:/newJava/bin/T0.jpeg");
    //label.setText("Frame"+ frameNumber);
    label.setIcon(icon);
    public static void main(String args[])
    AnimatorApplicationTimer animator=null;
    int fps=-1;
    if(args.length>0) {
    try {
    fps=Integer.parseInt(args[0]);
    catch (Exception e) {};
    animator=new AnimatorApplicationTimer(fps, "Animation with Timer");
    animator.pack();
    animator.setVisible(true);
    animator.startAnimation();
    //catch (Exception e){}

    in main after setVisible call animator.setSize(width,height)

  • How to make a frame with components and JTextAreas on it?

    on the Window 98 System, when you press F1 on the keyboard, you will get a window(frame) where there are "buttons" and "textAreas".
    i would like to create a JFrame like that, but how to realize it?
    thanks a lot!!!

    What do you want to do?
    You can easily create a JFrame, and then create JButtons and JTextAreas and then add() them to the JFrame's content pane.
    But you must know that already, so it must be something different you are confused about. What is it?

  • How to make a addChild modal ?

    Hello !!!
    I have a variable:
    var window=TitleWindow;
    and I'm doing:
    this.addChild(window);
    but needs to be modal. But, how?
    Thanks...
    Gilberto

    Martin ??
    Thanks very much for your reply.
    But I can not use because the addChild PopUpManager.addPopUp performs an effect ...
    Gilberto

  • How to make Internal Frame on Focus

    Hi All,
    i have an application where in i have a JInternalFrame within in A JFrame.
    Queries:
    1.I want to make JInternalFrame focused,(without clicking on any portoion of Internal Frame) once i run the apllication(java Demo)
    2.i want to fix the JInternal Frame.(Non movable)
    //Demo.java
    import java.io.*;
    import java.lang.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;     
    import javax.swing.event.*;     
    import javax.swing.border.*;          
    public class Demo extends JFrame implements ActionListener {
    static JDesktopPane desk;
    String labelstr="Test ";
    JPanel contentpane;
    JLabel titlelabel;
    public Demo() {
              setTitle("Swing Test");
                    contentpane=(JPanel)getContentPane();
                    contentpane.setLayout(new BorderLayout());
                    desk=new JDesktopPane();     
                    desk.setBackground(Color.gray);
                    contentpane.add("Center",desk);
                    titlelabel=new JLabel(labelstr);
                    titlelabel.setForeground(Color.black);
                    titlelabel.setBorder(new BevelBorder(BevelBorder.LOWERED));
                    getContentPane().add(titlelabel,BorderLayout.SOUTH);            
              public void actionPerformed(ActionEvent e) {
                 public static void main(String args[]) {     
                    try  {
                      UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
                      //UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                     }catch(Exception e) {
                                               System.out.println("Error loading L&F:"+e);     
                                               JOptionPane.showMessageDialog(null,e);
                    JFrame frame=new Demo();
                    frame.setSize(800,600);
                    frame.setVisible(true);
                      InternalFr jif=new InternalFr();
                      jif.start();
                    frame.addWindowListener(new CloseWindow());
           class CloseWindow extends WindowAdapter {
             public void windowClosing(WindowEvent we) {
                 Window w=we.getWindow();
                 w.dispose();
                 System.exit(0);
          }//InternalFr.java
    import java.io.*;
         import java.net.*;
         import java.lang.*;
         import java.awt.*;
         import java.awt.event.*;
         import javax.swing.*;
         import javax.swing.border.*;
         import javax.swing.text.*;
         public class InternalFr extends JInternalFrame {
             JLabel jlName, jlPass;
             static JTextField jtName,jtPass;
                 JButton submit,cancel;
            public InternalFr() {  
              super( "InternalFr");
              Icon img=new ImageIcon("Neticon.gif");
              setFrameIcon(img);
              JPanel contentpane=(JPanel)getContentPane();
               contentpane.setLayout(null);
              JPanel mainpanel=new JPanel();
              mainpanel.setLayout(null);
              mainpanel.setBounds(0,0,290,180);
              jlName=new JLabel("Username   :");
              jlName.setBounds(20,20,180,20);
              jlName.setForeground(Color.black);
              jtName=new JTextField();
              jtName.setBounds(150,20,100,20);
              mainpanel.add(jtName);
              mainpanel.add(jlName);
              jlPass=new JLabel("Password   :");
              jlPass.setBounds(20,50,180,20);
              jlPass.setForeground(Color.black);
              jtPass=new JTextField();
              jtPass.setBounds(150,50,100,20);
              mainpanel.add(jlPass);
              mainpanel.add(jtPass);
              JPanel buttonpanel=new JPanel();
              buttonpanel.setLayout(null);
              buttonpanel.setBounds(30,90,215,30);
              buttonpanel.setBorder(new EtchedBorder(EtchedBorder.RAISED));
              submit=new JButton("Submit");
              submit.setMnemonic('O');
              submit.setBounds(5,5,100,20);
              buttonpanel.add(submit);
              submit.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                 if(ae.getSource()==submit)  {
            cancel=new JButton("Cancel");
              cancel.setMnemonic('C');
              cancel.setBounds(110,5,100,20);
              buttonpanel.add(cancel);
              cancel.addActionListener(new ActionListener() {
                 public void actionPerformed(ActionEvent ae) {
                      Object obj=ae.getSource();
                     if(obj==cancel){
                          System.exit(0);
           contentpane.add(buttonpanel);
           contentpane.add(mainpanel);
        public void start()  {
             InternalFr at=new InternalFr();
             at.setSize(290,180);
            at.setLocation(220,150);
            at.setVisible(true);
            Demo.desk.add(at);
      }Thanks
    Mohan

    To give focus to an internal frame, do the following (where iFrame is your internal frame):try {
        iFrame.setIcon( false );  // In case it is minimized
        iFrame.moveToFront();     // Make sure it is in front
        iFrame.requestFocus();    // Ask for focus
        iFrame.setSelected( true );  // Select it
    } catch( java.beans.PropertyVetoException pve ) {
    }

  • How to make homemade frames?

    How do you go about making a frame such as the one in this example:
    http://photoma.my-expressions.com/index.html
    Thanks in advance.

    Jack,
    I originally posted this in another forum, but here it is again,
    how to create a 3D frame.
    http://www.pixentral.com/show.php?picture=13RZnH4exD8TdEkmW2Vs3p8ZLi9y1m0
    1. Set Background color to default white (see Note at end).
    2. Image>Resize>Canvas Size, and increase Height and Width by the same amount. This creates a white frame.
    3. Using the Magic Wand tool with the Contiguous box checked, select the frame.
    4. Set Foreground color to your frame color.
    5. Add new layer.
    6. Edit>Fill, using Foreground Color option.
    7. Window>Layer Styles. Choose the Bevels style.
    8. Choose one of the styles. In my example I used Simple Sharp Inner.
    9. To modify the bevel effect, click on the "f" symbol in the Layer's palette (truncated in my example), or from the menu bar Layer>Layer Style>Style Settings. This brings up the Style Settings dialog box where you can adjust various settings. You can also modify the frame via Layers>Layer Style>Scale Effect.
    If you want the frame inside the picture (not expanding the canvas):
    1. Use the Rectangular Marquee tool to draw out the frame.
    2. Invert the selection.
    3. Proceed with step 4. above.
    Note 1: In step 1, I chose white because my picture didn't have any white touching the frame. You can use any color; the goal is that when you do the Magic Wand it doesn't select anything within the picture. That's also why you check the Contiguous box.

  • How to make sure frames are present

    i am trying to open two web pages in a single window , but while browsing i am not able to keep my frames , when i press some links the frames r lost. What should i do to keep my frames in place and open pages without losing any frames
    i have used all these scripts
    <script language="javascript">
    if(self.location==top.location)self.location="main.html?top.html";
    </script>
    but not working .
    sorry if i palced in wrong fourm.

    You can check with a HTML / Javascript forum for a solution.
    Provide them more details about your HTML code, otherwise they won't understand where the problem is.

  • How to make a frame window not resizeable

    I am working on a little chat programm in java and I have an AWT GUI. What I need to accomplish is to make the window not resizeable. I used a simple Layout and whenever the window is resized, all my buttons and textfields go fly around all over the place. So is there a command to unable resizing the window by the user ? Please answer fast, I need to get it done today, if possible ....

    Never mind folks, I allready solved the problem ....

  • How to use single frame in a page

    Hello, i would like to now how to make a frame in a page
    without having two or more, i was used to work with GoLive and
    there i could use the grid an put a single frame and make links to
    other pages that would open in that frame, it worked wel for me,
    but since I switched from golive to dreamweaver CS3 i am not able
    to do so. Is there some one how could tel me how to do so, since i
    use a lot of single frames in my pages,
    greetings

    why are you wanting to use single frames?
    They allow having the initial frame address stay in the
    address bar, and not
    show the linked page's address. The problems they cause
    usually override any
    value.
    Or- if we aren't using the same words the same way, please
    give an example
    site of what you want to do.
    Alan
    Adobe Community Expert, dreamweaver
    http://www.adobe.com/communities/experts/

  • How to decrease photo frame width in photoshop?

    hi guys
    i have a small question to ask to the experts....i want to decrease the width of a wooden frame psd file to suit my design "the frame is so thick"
    simply scaling it down wont do the trick beacuase i will have only small version of it and i want to keep it general size "apart from its width obviously"
    in other words how to make the frame "thinner" but keep the size of it?
    thank you all in advance

    Well, here's one possibility:
    1.  Duplicate the document as several different documents.
    2.  Stretch one of them in the vertical dimension only, and the other in the horizontal dimension only.
    3.  Use the Rectangular Marquee tool to copy the longer, thinner sections independently and paste them in another image.
    Or you could generate a new frame...  There's a great(!) set of free framing actions out there made by a great guy named Bud Guinn online.  My internet connection is acting up today, and I couldn't complete a Google search for some reason, but look for "Bud Guinn framing action".
    Here's one link that shows them off...
    http://www.photozo.com/forum/showthread.php?t=63
    -Noel

  • Make Flash Frames Appear in Library As Pages? Need Help!

    I would like to know how to make flash frames appear in the Library as pages. Any code or help would be greatly appreciated.  Thank you.

    I want an area that opens like a page within the site (under the header) when buttons are clicked.

  • How to make a modal frame?

    Hello!
    My problem is quite simple, but I don't know how to make some MODAL frames (JFrame I mean). In my application, the user can open a same frame even if this frame is already opened and that's not really good.
    So, I want the user to close the frame before opening another one.
    Can anyone explain me how to do that?

    Generally your actionListener will be an internal class of your main frame class. Usually an anonymous internal class. That means it can act on variables in the frame (which is the sensible place to keep the flags).
    Something like:
    class Class1 extends JDesktop {
    boolean itsOpen = false;
    openAction.setActionListener(new ActionListener(){
      public void actionPerformed(ActionEvent e) {
        if(!itsOpen) {
           itsOpen = true;
           openAction.setEnabled(false);
           MyInternalFrame newFrame = new MyInternalFrame(Class1.this, ....);
           add(newFrame);
       });You do need some way for the internal frame to act on the variables in the main frame. There are various ways of achieving this.
    If we're dealing with a genuine InternalFrame there's a special InternalFrameListener (?) which allows your main frame to listen for the window closing. You can use this instead of hacking the dispose method.
    If you're main frame is a JDeskTop then you can use getDesktop() in your internal frame to access it, then cast the result to the real class of your desktop.
    Our you can simply add a pointer to your class1 to the contructor of your internal frame class.
    You could even get clever and create your own listener system.

  • How to make an internal frame a modal frame?

    aoa Friends i am trying to make a application using jframe with jdesktoppane and jinternal frame.is there any body who can guide me through that :
    how to make a jinternal frame a modal frame so that if a new jinternalform is opened than the previous one could not be accessed and if new one is closed then we can use that form.

    http://developer.java.sun.com/developer/JDCTechTips/2001/tt1220.html
    This is the example I used approach 2 to simulate a model frame.
    rykk

Maybe you are looking for

  • RAID Virtual Volumes Server 2008 R2 (Dell H200)

    Hi all, I am hoping someone can point me in the right direction. I am deploying a Dell R410 server with a Dell PERC H200 Controller with 4 X 300GB SAS Drives in two RAID1 arrays. I have loaded Server 2008 R2 onto the first volume. Unfortunately when

  • JasperReport Error

    Dear All i made Jasper Reperreport xml file, and i have working script in backing bean to run this report i am getting this error net.sf.jasperreports.engine.JRException: Error at line 8 char 8: net.sf.jasperreports.engine.design.JRDesignStyle cannot

  • Can the iPhone Finder app work for an iPad if I didn't enable 3G

    I have an iPad that has 3G, although I didn't activate it. I did, however, install and activate the iPhone finder on it. My question: Now that I left in in a seat-back on a plane, can I send a "message" to it, even though the 3G isn't active? Thanks!

  • Changes to .fla don't show up in Flash Builder run

    All, So, I've been developing applications in the Flash Pro IDE, and I've decided to try and use Flash Builder 4's advanced coding tools to make things a bit speedier and to help in profiling and debugging. The applications I'm looking at creating ge

  • Open / Save files window

    Hi, I have been using Raptor/Sqldeveloper since first public release, and really like it. Apart from the normal few glitches which can be expected, its great finally to have a proper gui tool to use in Linux. I have one problem/enhancement request th