Frame inside another Frame

Hi,
I am developing a GUI application like VB. How do I get Frame inside another Frame which can be moved.
kumanan

Hi,
The only way:
JDeskTopPane (as main window GUI)
and then use:
JInternalFrame (all other moveable windows)
Regards,
Manfred.

Similar Messages

  • How to put a string from one Frame to another Frame?

    Dear all,
    How can I put a String from one Frame to another Frame?
    When the application started, the Frame 'WindowX' will be displayed. After you press the 'openButton', a whole new Frame (inputFrame) will be shown. In this Frame )(inputFrame) you can write a String in a TextField. After pressing the okButton, this String will be sent to the first Frame 'WindowX'.
    But does anyone know how to realize the sending part?
    I've tested this code on Win98 SE and JDK1.2.2.
    Hope someone can help me. Thanks in advance.
    import java.awt.*;
    import java.awt.event.*;
    public class WindowX extends Frame implements ActionListener, WindowListener
         private Button openButton;
         private TextField resultField;
         public static void main(String [] args)
              WindowX wx = new WindowX();
              wx.setSize(300,100);
              wx.setVisible(true);
         public WindowX()
              setLayout(new FlowLayout());
              openButton=new Button("open");
              add(openButton);
              openButton.addActionListener(this);
              resultField=new TextField(10);
              add(resultField);
              resultField.addActionListener(this);
              addWindowListener(this);     
         public void actionPerformed(ActionEvent evt)
              if (evt.getSource()==openButton)
                   inputFrame ip=new inputFrame();
                   ip.setSize(200,80);
                   ip.show();
         public void place(String theString) //this doesn't work
              resultField.setText(theString);
         public void windowClosing(WindowEvent event)
              System.exit(0);
         public void windowIconi......
    class inputFrame extends Frame implements ActionListener,WindowListener
         String theString = "";
         Button okButton;
         TextField inputField;
         WindowX myWX=new WindowX();   //??
         public inputFrame()
              setLayout(new FlowLayout());
              inputField=new TextField(10);
              add(inputField);
              inputField.addActionListener(this);
              okButton=new Button("OK");
              add(okButton);
              okButton.addActionListener(this);     
              addWindowListener(this);     
         public static void main(String[] args)
              Frame f = new Frame();
              f.show();
         public void actionPerformed(ActionEvent evt)
              if (evt.getSource()==okButton)
                   theString=inputField.getText();
                   myWX.place(theString);   //??
                   dispose();
        public void windowClosing(WindowEvent e) {
        dispose();
        public void windowIconi......
    }

    Thanks for your reply!
    But I got an other problem:
    I can't refer to the object (wx) made from the main Frame 'WindowX', because it's initialized in 'public static void main(String [] args)'...
    Hope you can help me again... Thanks!
    import java.awt.*;
    import java.awt.event.*;
    public class WindowX extends Frame implements ActionListener, WindowListener
         private Button openButton;
         private TextField resultField;
         public static void main(String [] args)
              WindowX wx = new WindowX();   //!!
              wx.setSize(300,100);
              wx.setVisible(true);
         public WindowX()
              setLayout(new FlowLayout());
              openButton=new Button("open");
              add(openButton);
              openButton.addActionListener(this);
              resultField=new TextField(10);
              add(resultField);
              resultField.addActionListener(this);
              addWindowListener(this);     
         public void actionPerformed(ActionEvent evt)
              if (evt.getSource()==openButton)
                   inputFrame ip=new inputFrame(wx);
                   ip.setSize(200,80);
                   ip.show();
         public void place(String theString)
              resultField.setText(theString);
         public void windowClosing(WindowEvent event)
              System.exit(0);
         public void windowIconi....
    class inputFrame extends Frame implements ActionListener,WindowListener
         String theString = "";
         Button okButton;
         TextField inputField;
         WindowX parent;
         public inputFrame(WindowX parent)
              setLayout(new FlowLayout());
              this.parent=parent;
              inputField=new TextField(10);
              add(inputField);
              inputField.addActionListener(this);
              okButton=new Button("OK");
              add(okButton);
              okButton.addActionListener(this);     
              addWindowListener(this);     
         public static void main(String[] args)
              Frame f = new Frame();
              f.show();
         public void actionPerformed(ActionEvent evt)
              if (evt.getSource()==okButton)
                   theString=inputField.getText();
                   parent.place(theString);
                   dispose();
        public void windowClosing(WindowEvent e) {
        dispose();
        public void windowIconi..........
    }          

  • ADF : How to pass a variable from one frame to another frame ?

    Hi,
    I have an html page divided into 3 frames, all inside a frameset. Each frame are linked to a specific .jsf page (src attribute). When I list a list thanks to a ADF datatable in ONE frame, each row has a "show more" button. When I click this button I succeeded to print row detail inside the same frame thanks to the processScope ADF's native variable. The problem is that I want to display the row detail in another frame, clicking from this current frame. So for this I need to reload the other frame which display the content of the processScope variable.
    For this I use the javascript code :
    => parent.frames['bottomRight'].location.reload()
    Just before refreshing, I put the variable in the processScope of course like it appears in the backing bean :
    FacesContext context = FacesContext.getCurrentInstance();
              CLPRMBuilding building = (CLPRMBuilding)
         context.getApplication().getVariableResolver().resolveVariable(context, "building");
         if (building == null)
         return "error";
         AdfFacesContext afContext = AdfFacesContext.getCurrentInstance();
         afContext.getProcessScope().put("buildingDetail", building);
    Next, when the user click on the button "show more" a binding CoreCommandButton component is done. And the accessor's code is executed :
    public void setShowMoreCommandButton(CoreCommandButton showMoreCommandButton) {
              this.showMoreCommandButton = showMoreCommandButton;
              showMoreCommandButton.setOnclick("parent.frames['bottomRight'].location.reload()");
    And so the other frame is reloaded ! But the "buildingDetail" variable seems not to be present in the processScope because in the jsf page displayed by the other frame no content is printed, like if the variable were not initialized. How to do then ? How to pass the buildingDetail variable to the other frame which I need to reload to refresh it's content ?

    elaine_g wrote:
    I am wondering why does (r.a) give an error outside the method? What's the reason it only works when used inside the (b/r.a) maths function? This is illegal syntax:
    class B {
      int b;
      A r = new A();
      r.a;  //syntax error
    }Why? Class definition restricts what you can define within a class to a few things:
    class X {
        Y y = new Y(); //defining a field -- okay
        public X() { //defining a constructor -- okay
        void f() { //defining a method -- okay
    }... and a few other things, but you can't just write "r.a" there. It also makes no sense -- that expression by itself just accesses a field and does nothing with it -- why bother?
    This is also illegal syntax:
    int doB() {
          A r = new A();
          r.a;  // error: not a statement
    }Again, all "r.a" does on its own is access a field and do nothing with it -- a "noop". Since it has no effect, writing this indicates confusion on the part of the coder, so it classified as a syntax error. There is no reason to write that.

  • Passing data from one frame to another frame

    hello all, i am having a problem with passing data from one frame from another. I have a main frame when you click on connect button it display the second frame(class) that has 2 text fields and 2 buttons. When i click on connect it check if the data is correct. If the data is correct i want that frame to close and pass the data back to main frame. How can i do that.
    thank you

    hello all, i am having a problem with passing data
    from one frame from another. I have a main frame when
    you click on connect button it display the second
    frame(class) that has 2 text fields and 2 buttons.
    When i click on connect it check if the data is
    correct. If the data is correct i want that frame to
    close and pass the data back to main frame. How can
    i do that.
    thank you
    the original problem sounded like an ideal opportunity to use Modal Dialog. if you want one frame to display another to get user input then you need to stop the method in the main frame from executing until you recieve a valid input.
    you can use your own class and keep all of the components that you have in the connect frame but you would have to extend JDialog instead of JFrame.
    there is a way around it!
    if you must use JFrame for both, then you need to have access to the main frame in the connect frame, maybe pass the pointer to the constructor??
    anyway, when the connect frame is done with its duties, you have to use the pointer to call another method in the main frame that will continue the process. otherwise main frame doesn't know when connect frame is done and by that time, the method in main frame that instantiated the connect frame has long since died.
    also, it allows things to happen in the other window that you may not want to happen until the connect frame is done
    typically users of software start clicking around on things and you could have three or four connect frames going at the same time
    it's really best to use a Modal Dialog, it really can look just like a JFrame!!!!!!!!!!!!!!

  • How to copy a value from one Frame to another Frame.

    Hi,
    I am new to Swing and AWT prgramming .
    I have created a menu called " Test window " and it contains toplevel menu item "File" and File Menu contains subitems "Product Evaluation", "ProcessEvaluation", "ResourceEvalation", "TotalEvaluation" and "Exit".
    When i click File->Product Evaluation it displays a new Frame named frame1 , similarly if i click ProcessEvaluation , ResourceEvalation , TotalEvalation it displays frame 2 , frame 3 and frame 4 Respectively,
    frame 1 , frame 2, frame 3 contains four textfields with names t1,t2,t3 and t4.(NOTE: I have given same names for textfields in all three frames so that in future i want to extend my GUI).
    frame 4 contains 4 textfields with names t5,t6,t7,t8 and 4 buttons (b1,b2,b3,b4).
    After i compile my program i will select ProductEvaluation and enter some values in textfield of frame 1 and minimise it. Similary i will open ProcessEvaluation and TotalEvaluation and enter values in textfields of frame2 and frame3 and minimise them.
    My queston is now if i select TotalEvaluation and press Button1 in frame 4 it should display in textfield t5 the value extracted from t1 in frame1 added to the value extracted from t1 in frame 2 added to the value extracted from t1 in frame 3.
    ie after pressing Button 1 textfield t5 should conatin value of t1 in frame1+ value of t1 in frame2 + value of t1 in frame3.
    I am sending the code.
    Can you please help me.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.Component;
    // Make a main window with a top-level menu: File
    public class MainWindow extends Frame {
        public MainWindow() {
            super("Test Window");
            setSize(500, 500);
            // make a top level File menu
            FileMenu fileMenu = new FileMenu(this);
            // make a menu bar for this frame
            // and add top level menus File and Menu
            MenuBar mb = new MenuBar();
            mb.add(fileMenu);
            setMenuBar(mb);
            addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                    exit();
        public void exit() {
            setVisible(false); // hide the Frame
            dispose(); // tell windowing system to free resources
            System.exit(0); // exit
        public static void main(String args[]) {
            w = new MainWindow();
            w.setVisible(true);
        private static MainWindow w ;
        protected TextField t1, t2, t3, t4,t5,t6,t7,t8;
        // Encapsulate the look and behavior of the File menu
        class FileMenu extends Menu implements ActionListener {
            private MainWindow mw; // who owns us?
            private MenuItem itmPE   = new MenuItem("ProductEvaluation");
            private MenuItem itmPRE   = new MenuItem("ProcessEvaluation");
            private MenuItem itmRE   = new MenuItem("ResourceEvaluation");
            private MenuItem itmTE   = new MenuItem("TotalEvaluation");
            private MenuItem itmExit = new MenuItem("Exit");
            public FileMenu(MainWindow main) {
                super("File");
                this.mw = main;
                this.itmPE.addActionListener(this);
                this.itmPRE.addActionListener(this);
                this.itmRE.addActionListener(this);
                this.itmTE.addActionListener(this);
                this.itmExit.addActionListener(this);
                this.add(this.itmPE);
                this.add(this.itmPRE);
                this.add(this.itmRE);
                this.add(this.itmTE);
                this.add(this.itmExit);
            // respond to the Exit menu choice
            public void actionPerformed(ActionEvent e) {
                if (e.getSource() == this.itmPE) {
                   final Frame frame1 = new Frame("Frame1");
                    frame1.setSize(700,700);
                    frame1.setLayout(null);
                    t1 = new TextField("");
                    t1.setBounds(230, 230, 50, 24);
                    frame1.add(t1);
                    t2 = new TextField("");
                    t2.setBounds(330, 230, 50, 24);
                    frame1.add(t2);
                    t3 = new TextField("");
                    t3.setBounds(430, 230, 50, 24);
                    frame1.add(t3);
                    t4 = new TextField("");
                    t4.setBounds(530, 230, 50, 24);
                    frame1.add(t4);
                    frame1.addWindowListener(new WindowAdapter() {
                        public void windowClosing(WindowEvent e) {
                            frame1.dispose();
                    frame1.setVisible(true);
                else
                if (e.getSource() == this.itmPRE) {
                  final  Frame frame2 = new Frame("Frame2");
                    frame2.setSize(700,700);
                    frame2.setLayout(null);
                    t1 = new TextField("");
                    t1.setBounds(230, 230, 50, 24);
                    frame2.add(t1);
                    t2 = new TextField("");
                    t2.setBounds(330, 230, 50, 24);
                    frame2.add(t2);
                    t3 = new TextField("");
                    t3.setBounds(430, 230, 50, 24);
                    frame2.add(t3);
                    t4 = new TextField("");
                    t4.setBounds(530, 230, 50, 24);
                    frame2.add(t4);
                    frame2.addWindowListener(new WindowAdapter() {
                        public void windowClosing(WindowEvent e) {
                            frame2.dispose();
                    frame2.setVisible(true);
               else
               if (e.getSource() == this.itmRE) {
                 final   Frame frame3 = new Frame("Frame3");
                    frame3.setSize(700,700);
                    frame3.setLayout(null);
                    t1 = new TextField("");
                    t1.setBounds(230, 230, 50, 24);
                    frame3.add(t1);
                    t2 = new TextField("");
                    t2.setBounds(330, 230, 50, 24);
                    frame3.add(t2);
                    t3 = new TextField("");
                    t3.setBounds(430, 230, 50, 24);
                    frame3.add(t3);
                    t4 = new TextField("");
                    t4.setBounds(530, 230, 50, 24);
                    frame3.add(t4);
                    frame3.addWindowListener(new WindowAdapter() {
                        public void windowClosing(WindowEvent e) {
                            frame3.dispose();
                    frame3.setVisible(true);
                else
                if (e.getSource() == this.itmTE) {
                  final  Frame frame4 = new Frame("Frame4");
                    frame4.setSize(700,700);
                    frame4.setLayout(null);
                    t5 = new TextField("");
                    t5.setBounds(170, 230, 50, 24);
                    frame4.add(t5);
                    t6 = new TextField("");
                    t6.setBounds(270, 230, 50, 24);
                    frame4.add(t6);
                    t7 = new TextField("");
                    t7.setBounds(370, 230, 50, 24);
                    frame4.add(t7);
                    t8 = new TextField("");
                    t8.setBounds(470, 230, 50, 24);
                    frame4.add(t8);
                    ActionListener action = new MyActionListener(frame4, t5, t6, t7, t8);
                    Button b1  = new Button("Button1");
                    b1.setBounds(170, 400, 120, 24);
                    b1.addActionListener(action);
                    frame4.add(b1);
                    Button b2  = new Button("Button2");
                    b2.setBounds(300, 400, 120, 24);
                    b2.addActionListener(action);
                    frame4.add(b2);
                    Button b3  = new Button("Button3");
                    b3.setBounds(420, 400, 120, 24);
                    b3.addActionListener(action);
                    frame4.add(b3);
                    Button b4  = new Button("Button4");
                    b4.setBounds(550, 400, 120, 24);
                    b4.addActionListener(action);
                    frame4.add(b4);
                    frame4.addWindowListener(new WindowAdapter() {
                        public void windowClosing(WindowEvent e) {
                            frame4.dispose();
                    frame4.setVisible(true);
                else {
                    mw.exit();
          class MyActionListener implements ActionListener {
                private Frame frame4;
                private TextField t5;
                private TextField t6;
                private TextField t7;
                private TextField t8;
                public MyActionListener(Frame frame4,TextField tf5, TextField tf6, TextField tf7, TextField tf8)
                    this.frame4 = frame4;
                    this.t5 = tf5;
                    this.t6 = tf6;
                    this.t7 = tf7;
                    this.t8 = tf8;
                public void actionPerformed(ActionEvent e) {
                    String s = e.getActionCommand();
                    if (s.equals("Button1")) {
             // I think code for the Button1 action can be written here  
        

    hi,
    u have ot submit the values using
    b1 for f1,
    b1 for f2 and
    b1 forf3
    after u can access the values in to f4 other wise u con't
    what u have to do use method in each frame like
    setValueforframe1() { } and 2 and 3
    and u can call this method in frame 4 and u can get the values

  • How to copy value from one frame to another frame

    Hi,
    I am new to swing prgramming .
    I have created a menu called " TopFrame " and it contains toplevel menu item "select" and select Menu contains subitems "firstframe", "secondframe", "thirdframe" and "Exit".
    When i click select->firstframe it displays a new Frame f1 with a
    textfield t1. I enter value in textfield t1 and minimise the frame.
    similarly when i click select->secondframe it displays a new Frame f2 with a textfield t1. I enter value in textfield t1 and minimise the frame.
    now when i click select->thirdframe it displays a frame f3 which contains button called "Totalvalue" and a textfield t2 .
    MY question is after opening frame f3 when i press "Totalvalue" button it should add the values from textfield t1 from both the frames f1 and f2 and display the result in textfield t2 of frame f3.
    Actually my application is big but for better understanding i have reduced the description above.
    I am posting the code...Kindly help me
    thanks in advance..
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.Component;
    import java.awt.Checkbox;
    import javax.swing.*;
    import java.text.DecimalFormat;
    import javax.swing.JComponent;
    public class MainWindow extends Frame {
      public MainWindow() {
        super("TopFrame");
        setSize(600, 600);
        // make a top level File menu
        FileMenu fileMenu = new FileMenu(this);
        // make a menu bar for this frame 
        // and add top level menus File and Menu
        MenuBar mb = new MenuBar();
        mb.add(fileMenu);
        setMenuBar(mb);
        addWindowListener(new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            exit();
      public void exit() {
        setVisible(false); // hide the Frame
        dispose(); // tell windowing system to free resources
        System.exit(0); // exit
      public static void main(String args[]) {
        MainWindow w = new MainWindow();
        w.setVisible(true);
        w.setBackground(Color.white);
    private static MainWindow w ;
    protected TextField t1, t2;
      class FileMenu extends Menu implements ActionListener {
      private MainWindow mw; // who owns us?
      private MenuItem itm1   = new MenuItem("Firstframe");
      private MenuItem itm2   = new MenuItem("Secondframe");
      private MenuItem itm3   = new MenuItem("Thirdframe");
      private MenuItem itmExit = new MenuItem("Exit");
        public FileMenu(MainWindow main)
        super("Select");
        this.mw = main;
        this.itm1.addActionListener(this);
        this.itm2.addActionListener(this);
        this.itm3.addActionListener(this);
        this.itmExit.addActionListener(this);
        this.add(this.itm1);
        this.add(this.itm2);
        this.add(this.itm3);
        this.add(this.itmExit);
      public void actionPerformed(ActionEvent e)
        if (e.getSource() == this.itm1)
         final Frame f1 = new Frame("first frame opened");
         f1.setSize(500,500);
         f1.setLayout(null);
         Label l1 = new Label("Enter first value below");
         l1.setBounds(220, 250, 240, 24);
         f1.add(l1);
         TextField t1 = new TextField("0");
         t1.setBounds(260, 300, 40, 24);
         f1.add(t1);
          f1.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e)
              //System.exit(0);
               f1.dispose();
         f1.show();
       else
       if (e.getSource() == this.itm2)
         final Frame f2 = new Frame("second frame opened");
         f2.setSize(500,500);
         f2.setLayout(null);
         Label l1 = new Label("Enter first value below");
         l1.setBounds(220, 250, 240, 24);
         f2.add(l1);
         TextField t1 = new TextField("0");
         t1.setBounds(260, 300, 40, 24);
         f2.add(t1);
          f2.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e)
              //System.exit(0);
               f2.dispose();
         f2.show();
       else
       if (e.getSource() == this.itm3)
         final Frame f3 = new Frame("third frame opened");
         f3.setSize(500,500);
         f3.setLayout(null);
         JButton b1  = new JButton("Totalvalue");
         b1.setBounds(220, 300, 180, 24);
         f3.add(b1); 
         TextField t2 = new TextField("0");
         t2.setBounds(410, 300, 40, 24);
         f3.add(t2);
         f3.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e)
              //System.exit(0);
               f3.dispose();
         f3.show();
       else
       { mw.exit();}

    hi ,
    I have extended my application ...i have some doubts can you please clear my doubts..
    Now i have two textfields t1 and t2 in both the frames frame 1 and frame 2 and i have 2 buttons Button1 and Button2, textfields t5 and t6 in frame3.
    Now my question is i enter some values in t1 and t2 in frame1, and t1 and t2 in frame2 and minimise or close them...when i open frame3 and press Button1 it should take values from t1 in both frame1 and frame2 , add them and display the result in t5( in frame3)... similarly when i press Button2 it should take values from t2 in both frame1 and frame2, add them and display the result in t6(in frame3).
    Can you please tell me how can i do this?
    Thanks in advance.
    I am posting the code...
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.Component;
    // Make a main window with a top-level menu: File
    public class MainWindow extends Frame {
        public MainWindow() {
            super("Test Window");
            setSize(500, 500);
            // make a top level File menu
            FileMenu fileMenu = new FileMenu(this);
            // make a menu bar for this frame
            // and add top level menus File and Menu
            MenuBar mb = new MenuBar();
            mb.add(fileMenu);
            setMenuBar(mb);
            addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                    exit();
        public void exit() {
            setVisible(false); // hide the Frame
            dispose(); // tell windowing system to free resources
            System.exit(0); // exit
        public static void main(String args[]) {
            w = new MainWindow();
            w.setVisible(true);
        private static MainWindow w ;
        protected TextField t1, t2,t5,t6;
        // Encapsulate the look and behavior of the File menu
        class FileMenu extends Menu implements ActionListener {
            private MainWindow mw; // who owns us?
            private MenuItem itmPE   = new MenuItem("ProductEvaluation");
            private MenuItem itmPRE   = new MenuItem("ProcessEvaluation");
            private MenuItem itmTE   = new MenuItem("TotalEvaluation");
            private MenuItem itmExit = new MenuItem("Exit");
            public FileMenu(MainWindow main) {
                super("File");
                this.mw = main;
                this.itmPE.addActionListener(this);
                this.itmPRE.addActionListener(this);
                this.itmTE.addActionListener(this);
                this.itmExit.addActionListener(this);
                this.add(this.itmPE);
                this.add(this.itmPRE);
                this.add(this.itmTE);
                this.add(this.itmExit);
            // respond to the Exit menu choice
            public void actionPerformed(ActionEvent e) {
                if (e.getSource() == this.itmPE) {
                   final Frame frame1 = new Frame("Frame1");
                    frame1.setSize(700,700);
                    frame1.setLayout(null);
                    t1 = new TextField("");
                    t1.setBounds(230, 230, 50, 24);
                    frame1.add(t1);
                    t2 = new TextField("");
                    t2.setBounds(330, 230, 50, 24);
                    frame1.add(t2);
                    frame1.addWindowListener(new WindowAdapter() {
                        public void windowClosing(WindowEvent e) {
                            frame1.dispose();
                    frame1.setVisible(true);
                else
                if (e.getSource() == this.itmPRE) {
                  final  Frame frame2 = new Frame("Frame2");
                    frame2.setSize(700,700);
                    frame2.setLayout(null);
                    t1 = new TextField("");
                    t1.setBounds(230, 230, 50, 24);
                    frame2.add(t1);
                    t2 = new TextField("");
                    t2.setBounds(330, 230, 50, 24);
                    frame2.add(t2);
                    frame2.addWindowListener(new WindowAdapter() {
                        public void windowClosing(WindowEvent e) {
                            frame2.dispose();
                    frame2.setVisible(true);
                else
                if (e.getSource() == this.itmTE) {
                  final  Frame frame3 = new Frame("Frame4");
                    frame3.setSize(700,700);
                    frame3.setLayout(null);
                    t5 = new TextField("");
                    t5.setBounds(170, 230, 50, 24);
                    frame3.add(t5);
                    t6 = new TextField("");
                    t6.setBounds(270, 230, 50, 24);
                    frame3.add(t6);
                    ActionListener action = new MyActionListener(frame3,t5,t6);
                    Button b1  = new Button("Button1");
                    b1.setBounds(170, 400, 120, 24);
                    b1.addActionListener(action);
                    frame3.add(b1);
                    Button b2  = new Button("Button2");
                    b2.setBounds(300, 400, 120, 24);
                    b2.addActionListener(action);
                    frame3.add(b2);
                    frame3.addWindowListener(new WindowAdapter() {
                        public void windowClosing(WindowEvent e) {
                            frame3.dispose();
                    frame3.setVisible(true);
                else {
                    mw.exit();
          class MyActionListener implements ActionListener {
                private Frame frame3;
                private TextField t5;
                private TextField t6;
                public MyActionListener(Frame frame3,TextField tf5,TextField tf6)
                    this.frame3 = frame3;
                    this.t5 = tf5;
                    this.t6 = tf6;
                public void actionPerformed(ActionEvent e) {
                    String s = e.getActionCommand();
                    if (s.equals("Button1")) {
             // I think code for the Button1 action can be written here  
          else if (s.equals("Button2")) {
             // I think code for the Button2 action can be written here  
           

  • How to call a frame from another frame?

    Hi
    I have a frame with constructor
    public TestAudibleAlert(String args[])
         super(args,
                "Test",
                ProcessConstants.FORM_TEST_AUDIBLE_ALERT,
                true,
                MENU_BASIC,
                TOOL_BASIC);
           init();
    {code }
    I need to call the same constructor from some other file which is a Frame. I am not knowing how to do this. I am trying as :
    TestAudibleAlert = new TestAudibleAlert(args).
    I don't no how to iniialize args in the second file.
    Edited by: jackdoing on Nov 26, 2008 1:04 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    So you want to know how to declare and initialize a String[]?
    String[] args = {"One", "Two", "Three"};[http://java.sun.com/docs/books/tutorial/java/nutsandbolts/arrays.html]

  • Passing parameters from a frame to another frame

    Hello All,
    I have a BSP page with 2 frames : header.htm and planning.htm
       <frameset rows="150,*" frameborder="0" border="0">
          <htmlb:documentBody >
                <frame style="border-right-style:solid;border-color:#333333;border-width:1px" src="header.htm" id="header" name="header" scrolling="no" noresize frameborder="no">
               <frameset  frameborder="0">
                    <frame style="border-right-style:solid;border-color:#A5B1BF;border-width:1px" src="planning.htm" id="planning" name="planning" scrolling ="yes">
             </frameset>
           </htmlb:documentBody>
       </frameset>
    1. I want to send parameters from header.htm to planning.htm when a button CREATE in header.htm is pushed.
    2. I also want to execute the code in OnInputProcessing of planning.htm at the same time (when the button in header.htm is push).
    Can someone help me please? I read many pots but i wasn't able to find a solution to my problem. I also have a look to HTMLB_SAMPLES, and SBSPEXT_HTMLB, but i didn't understand well.
    Thank you

    Hi,
    if I were you I´d better work with views and controller classes instead of pages with logic. In this way you don´t have to send parameters from page 1 to page 2 and you don´t have to trigger an event so that page 2 is called and method OnInputProcessing is executed.
    Change the type of your pages to views, create the controllers for each and the controller class(es) behind it. If your development is very complex I´d create a model class, so that variables and common method are available to all controller classes and pages.
    You have the advantage that you don´t have to hang parameters into the URL, which then must be read by page 2 when somebody presses button X in page 1. This method could be insecure, because it is easy to ready parameters from the URL by a hacker. Additionally, how do you expect to trigger an event in page 2 when the event really happens in page 1 ??

  • ¿Can I call a function in a frame from another frame?

    In a Canvas HTML5 document. I use javascript and easeljs.
    I declare a function in frame 1:
    function ponerBicho() {
        this.bichofuncion.cabeza.nariz.gotoAndStop(1);
    then I call it in frame 9 (in the same timeline):
    ponerBicho.call(this);
    this.stop();
    It dont works.
    But if I put the declaration in the same frame, frame 9, it works.
    function ponerBicho() {
        this.bichofuncion.cabeza.nariz.gotoAndStop(1);
    ponerBicho.call(this);
    this.stop();
    Where is the problem?
    I really appreciate your help.
    (Im begineer )

    It works. Thank you very much, Nipun. 
    Suggestion: Adobe should do a good manual for Canvas's use from the beginning. As those who exist of ActionScript. It is very hard for not programmers to have to learn javascript + createjs out of Flash.

  • Copying content from one frame to another frame

    Hi All,
    In my application, i want popup frame to enter the values when clicking the mouse(Double Click). I open the new frame by using the following code
    JFrame frame = new NewJFrame("PopUp Frame");
    frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
    JLabel label = new JLabel("PopUp Frame");
    //Create and set up the content pane.
    frame.getContentPane().add(label);
    frame.setResizable(false);
    //Display the window.
    frame.pack();
    frame.setVisible(true);
    In this new frame if i entered the value in the textbox how can i take it in the main screen where the mouseclicked to open this new frame?
    Please if anyone know give the solution.

    Use code tags to post codes -- [code]CODE[/code] will display asCODEOr click the CODE button and paste your code between the {code} tags that appear.
    To get better help sooner, post a [_SSCCE_|http://mindprod.com/jgloss/sscce.html] that clearly demonstrates your problem.
    i want popup frameIt's better to use a modal JDialog. A GUI application should normally have only one JFrame.
    In this new frame if i entered the value in the textboxWhat's a textbox?
    db
    edit It's not polite to post a new question without replying to a response on an earlier one.
    [http://forums.sun.com/thread.jspa?threadID=5395152]
    Edited by: DarrylBurke

  • Go to frame then another frame

    Hi, hope youre all well!
    I am trying to execute the following.
    Click on button 1 - play frames 1-5, then play frame 10
    click on button 2 - play frames 1-5, then 11
    click on button 3 - play frames 1-5, then 12
    I have got it so that they play frames 1-5 but I dont know how to type the code so that it plays a frame after it has played 1-5, Can anyone help?
    Thanks in advance

    you can use the function below.  it needs no changes.  to play the root timeline from 1-5, and then frame 11, use:
    // the first parameter is the movieclip you want to play.  the 2nd and all even parameters are the start frames and the parameter that follows a start frame is an end frame:
    playArrayF(MovieClip(root),[1,5,11,11]);
    function playArrayF(mc:MovieClip,a:Array){
        var tempMC:MovieClip=new MovieClip();
        var f:Function = function(e:Event){
            if(!afterJump){
                mc.gotoAndStop(a[index]);
                afterJump=true;
            } else {
                if(a[index]<a[index+1]){
                    mc.nextFrame();
                } else {
                    mc.prevFrame();
            if(mc.currentFrame==a[index+1]){
                index+=2;
                afterJump = false;
                if(index>=a.length){
                    tempMC.removeEventListener(Event.ENTER_FRAME,f);
                    tempMC=null;
        var afterJump:Boolean = false;
        var index:uint=0;
        tempMC.addEventListener(Event.ENTER_FRAME,f);

  • How do I go directly from one frame to another particular frame which is far away in the time line? (e.g the two frames are separated by 100 frames)

    How do I go directly from one frame to another particular frame which is far away in the time line? (e.g the two frames are separated by 100 frames). I mean, is it possible to take the playhead from one frame to another frame directly which is 100 frames away in the time line? Thanks for any reply.

    In the Timeline, go to the first frame and press M to put a marker on it. Go to the other frame you want to jump to and put a marker on that one too.
    Now press Ctrl+Semicolon to go to the previous marker - or Ctrl+Comma to go to the next marker.
    Andy

  • Close a Frame when another one opened

    How do i Close a frame (dependent Frame) when another frame opened
    dispose() method did nothing and so do system.exit(0); as the System.exit(0) close the whole app that meant also the frame i would like to open when the other frame closed and moved from " Memory " huge topic for me
    dispose(); didn't do what i really needed to happened
    please any suggestions ASAP ? i need that in swing app

    i used dispose() but didn't work with me as i noticed the memory usage with this java app when i run the app after closing the frame . the memory usage didn't change that meant as least the frame didn't closed or cleared from the memory ?!
            try {
                    Socket ss = new Socket("14.23.5.122", 1235);
                  //  JOptionPane.showMessageDialog(null, "Server's OK", "Connection", JOptionPane.INFORMATION_MESSAGE);
                    new LoginFrame().setVisible(true);
                  //  this.dispose();
                    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                } catch (UnknownHostException eh) {
                    System.out.println("Unknow Host Exception"+ eh.getMessage());
                } catch (IOException eo) {
                    System.exit(0);
                   System.out.println("IO Exception"+ eo.getMessage());
             /*finally{
            System.exit(0);
            }*/

  • Cant' move images from frame to frame inside a Grid in InDesign. Please Help

    When creating a grid in indesign there is an option to move images from frame to frame, and having them rotate around the frames to see where each image is best to be placed. Example I created a grid with 6 images (2 rows and 3 columns) and now i want image 1 to be where image 6 is. I know there's a way by hitting the arrows and some other keys and have all the images start rotating. I did it once I just can't remember. Please help. How do you move the an image from one frame to another frame without having to go to edit place?
    Thanks,
    Paola

    Swapping images

  • Is it possible to place a video inside a frame or behind an object to crop it?

    I'm trying to place a video behind a psd of a TV screen that is a different aspect ratio than the placed video. When I try to place it inside a frame or behind the psd with a clear window, it will not export to interactive pdf as such. It shows the vid full size. Is there any way around this?

    Lauragalora119,
    There's a way around this. But it takes a few steps.
    Place your video as usual.
    Now, create a frame that would be the outside of the TV screen. Now create another curved corner rectangle that would be the screen of the TV. Select them both. I would make these outside the area of the video as you don't want the video to be the in the next step.
    With those two frames selected, choose Objects> Pths> Compound Path Make.
    You now have a hole in the frames.
    Fill with a color or Paper. Optional: Import an image of the woodgrain of a TV set.
    Now, with this compound path selected, choose Buttons and Forms and make this a button that does nothing.
    Now, if you were to export this as a PDF, the video will play "inside" the screen frame but it's really playing behind a button. The button is on top of the video because it was on top of the video in the ID file.
    However, you can't click on the video to play it because it's behind the button. PDFs don't recognize the holes in compound paths.
    SO, back in InDesign, I created a little round button that I would consider the dial to turn on the TV. (I'm old enough to remember televisions that had rounded objects to turn them on and off. You may want a more digital looking object.)
    This button will have an action applied that plays the video.
    TaDa!!! You've done it!
    And your day is not ruined.

Maybe you are looking for

  • My flash player is not working in Youtube! Please help!

    I have the version 10,2,152,32 installed. it works in facebook and i can play games like Farmville, but it just isn't working in Youtube. it would just show a black box which would immediately disappear. this is what happends when i use internet expl

  • Populating error message based on search help

    Hi team, How can we populate error message in a shopping cart account assignment "order " field for the bellow two senarios. I am adding a custom field called "Operational Activity" in account assignment. based on which search help has to be done the

  • Lots of error in server's system log

    I just installed SAPNetWeaver04_SP16Preview in a fresh Windows 2003 SP1. I am running it in VMware 1.0.3. I assigned VM 924MB RAM, 32GB hard drive and 2 Processors. Running JDK 1.4.2_09 After installation, I start the <b>J2E</b> from <b>SAP Managemen

  • Difference bet  se09 and se10

    Hi all pls tell the  difference bet  se09 and se10    Regards. Nagendra.

  • NW2004s EP install error

    Install EP scenario on WAS java. My environment is AIX oracle. I run into error during the install. Cannot create the secure store; see output of log file SecureStorageCreate.log: JVMXM008 : error occured while initialising System Class Exception in