Help, on calling another frame

I am doing a program which start with a frame. Where is a button, by clicking it, another window may popup to show some running msg of the main window. I decide to use two frames to do that. One is the main window and another one will be visible when that button is clicked. Now my problem is the second window(frame) did come up, but the JTextArea inside it is not been displayed. There is one time that the second window displayed its content when some process in main window throws exceptions. I have no idea what I did wrong.
second window:
public class networkConnect extends JFrame {
    public JLabel msgLbl;
    public JTextArea msgArea;
    public networkConnect()
        Toolkit kit = Toolkit.getDefaultToolkit();
        Dimension screenSize = kit.getScreenSize();
        int screenHeight = screenSize.height;
        int screenWidth = screenSize.width;
        msgLbl = new JLabel();
        this.msgArea = new JTextArea(30,50);
        this.msgArea.setEditable(false);
        this.getContentPane().add("Center", new JScrollPane(msgArea));
        this.setTitle("Connection Message");
        this.setSize(150,70);
        this.setLocation(screenWidth/4,screenHeight/4);
        this.pack();
        this.show();
}In main window:
networkConnect netConnect = new networkConnect();
netConnect.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
netConnect.setVisible(true);
netConnect.......Thank you!!

for instance:
import java.awt.*;
import javax.swing.*;
public class NetWorkConnect
  private static final Dimension PANEL_SIZE = new Dimension(250, 170);
  private JPanel mainPanel = new JPanel();
  private JTextArea msgArea = new JTextArea(30, 50);
  public NetWorkConnect()
    msgArea.setEditable(false);
    mainPanel.setPreferredSize(PANEL_SIZE);
    mainPanel.setLayout(new BorderLayout());
    mainPanel.add(new JScrollPane(msgArea), BorderLayout.CENTER);
  public JComponent getComponent()
    return mainPanel;
  public void appendMessage(String message)
    msgArea.append(message);
  public void clearMsgArea()
    msgArea.setText("");
import java.awt.*;
import java.awt.Dialog.*;
import java.awt.event.*;
import javax.swing.*;
public class NetWorkConnectMain
  private JPanel mainPanel = new JPanel();
  private JTextField textfield = new JTextField(20);
  private NetWorkConnect netConnect = new NetWorkConnect();
  private JDialog dialog;
  private JButton appendTextBtn;
  public NetWorkConnectMain()
    JButton showNetConnectBtn = new JButton("Show NetConnect");
    appendTextBtn = new JButton("Append Text to NetConnect");
    textfield.setEnabled(false);
    appendTextBtn.setEnabled(false);
    showNetConnectBtn.addActionListener(new ActionListener()
      public void actionPerformed(ActionEvent arg0)
        showNetConnectAction();
    appendTextBtn.addActionListener(new ActionListener()
      public void actionPerformed(ActionEvent arg0)
        appendTextAction();
    mainPanel.add(showNetConnectBtn);
    mainPanel.add(textfield);
    mainPanel.add(appendTextBtn);
  private void showNetConnectAction()
    if (dialog == null)
      Window windowAncestor = SwingUtilities.getWindowAncestor(mainPanel);
      dialog = new JDialog(windowAncestor, "Connection Message", ModalityType.MODELESS);
      dialog.getContentPane().add(netConnect.getComponent());
      dialog.pack();
      dialog.setLocationRelativeTo(null);
      dialog.setVisible(true);
    else if (!dialog.isVisible())
      dialog.setVisible(true);
    appendTextBtn.setEnabled(true);
    textfield.setEnabled(true);
  public void appendTextAction()
    if (dialog != null && netConnect != null)
      netConnect.appendMessage(textfield.getText() + "\n");
  public JComponent getComponent()
    return mainPanel;
  private static void createAndShowUI()
    JFrame frame = new JFrame("NetWork Connect Main");
    frame.getContentPane().add(new NetWorkConnectMain().getComponent());
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.pack();
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
  public static void main(String[] args)
    java.awt.EventQueue.invokeLater(new Runnable()
      public void run()
        createAndShowUI();
}

Similar Messages

  • One Class Calling Another Class ......Need Help..ugh

    this is the class that calls another class called cuboid
    package WindowsApplication1;
    * Summary description for Cuboid.
    //Import the classes to allow the use of the array, iterator and listiterator
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.ListIterator;
    public class DisplayCuboidValues
         public static void main(String args[])
              //Create the array list
              ArrayList VolumeList = new ArrayList();
              //Create the counter to loop 4 times and get 4 different volumes. Modify the counter
              //if you need a different values
              int Counter = 1;
              //Initialize the counter to loop 4 times in order to get the 4 objects
              while (Counter < 5)
                   Cuboid mp = new Cuboid(2, 4, 3);
                   //Add the values to the array
                   VolumeList.add(mp);
                   // get the volume again via accessor method(Optional)
                   //int Volume = mp.Volume();
                   //System.out.println(Volume);
                   //Increment the counter to obtain a new value in the array
                   Counter = Counter + 1;
              // Retrieve iterator to the radiuslist
              Iterator itr1 = VolumeList.iterator();
              while (itr1.hasNext())
              // call Cuboid.toString()
              System.out.print(itr1.next());
              System.out.println();
    }this is the cuboid class
    package WindowsApplication1;
    * Summary description for Cuboid.
    public class Cuboid
         private final int length, width, height;
         //1st contructor with 3 arguments
         public Cuboid(int length, int width, int height)
              this.length = length;
              this.width = width;
              this.height = height;
         //2nd constructor with no arguments
    //I BELIEVE THIS PUBLIC CUBOID IS THE ONE THE PROVOKES THE ERROR. BUT I CAN NOT DELETE IT BECAUSE I NEED ANOTHER PUBLIC CUBOID. SO IDK WHAT TO DO......
         public Cuboid()
              this.length = length;
              this.width = width;
              this.height = height;
            public String toString() {
                   return "This cuboid has length x, width y, height z, and has volume of v where X=" + length + " " + "Y=" + width + " " + "Z=" + height + " " + "Volume=" + length * width * height + ".   --   ";
         //Method to calculate the Volume
         public int Volume()
              return length * width * height;
         }This is what i have done. I have created a project named ths(which i do not use it at all). Then, i created one file called DisplayCuboidValues under ths. Then i created the file Cuboid under ths too. But it gives me errors. like this one:
    init:
    deps-jar:
    Created dir: C:\Documents and Settings\Owner\ths\build\classes
    Compiling 1 source file to C:\Documents and Settings\Owner\ths\build\classes
    C:\Documents and Settings\Owner\ths\src\DisplayCuboidValues\Cuboid.java:25: variable length might not have been initialized
    this.length = length;
    *^*
    C:\Documents and Settings\Owner\ths\src\DisplayCuboidValues\Cuboid.java:26: variable width might not have been initialized
    this.width = width;
    *^*
    C:\Documents and Settings\Owner\ths\src\DisplayCuboidValues\Cuboid.java:27: variable height might not have been initialized
    this.height = height;
    *^*
    Note: C:\Documents and Settings\Owner\ths\src\DisplayCuboidValues\DisplayCuboidValues.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    *3 errors*
    BUILD FAILED (total time: 0 seconds)
    Any help you can give me will be appreciated. Thanks.

    yeah. you are right in that. so that means that i have to get rid of it??. because i will need it. and the values assigned to them is in the first class that calls the second class look:
    package WindowsApplication1;
    * Summary description for Cuboid.
    //Import the classes to allow the use of the array, iterator and listiterator
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.ListIterator;
    public class DisplayCuboidValues
         public static void main(String args[])
              //Create the array list
              ArrayList VolumeList = new ArrayList();
              //Create the counter to loop 4 times and get 4 different volumes. Modify the counter
              //if you need a different values
              int Counter = 1;
              //Initialize the counter to loop 4 times in order to get the 4 objects
              while (Counter < 5)
    *//HERE IS WHERE I AM PROVIDING THE OTHER CLASS WITH VALUES. THEREFORE IT SHOULD SENT THOSE VALUES TO MY CLASS CUBOID AND RETRIEVE THE ANSWER TO FOLLOW THE REST OF THIS CODE.*
                   Cuboid mp = new Cuboid(2, 4, 3);
                   //Add the values to the array
                   VolumeList.add(mp);
                   // get the volume again via accessor method(Optional)
                   //int Volume = mp.Volume();
                   //System.out.println(Volume);
                   //Increment the counter to obtain a new value in the array
                   Counter = Counter + 1;
              // Retrieve iterator to the radiuslist
              Iterator itr1 = VolumeList.iterator();
              while (itr1.hasNext())
              // call Cuboid.toString()
              System.out.print(itr1.next());
              System.out.println();
    }

  • I have a VI A. I want A to call another VI B and execute. After B executes, I want it to close automatically and go back to A. Is this possible ? I tried using open reference and those methods, but I am not able to do it. Can someone help me ? Thanks !

    Thanks !
    Kudos always welcome for helpful posts

    Re: I have a VI A. I want A to call another VI B and execute. After B executes, I want it to close automatically and go back to A. Is this possible ? I tried using open reference and those methods, but I am not able to do it. Can someone help me ? Thanks !Hi Stephan ! Thanks ! I guess I explained my question not so right. I've created a customized menu and at the instance of me selecting a menu, a VI should load itself dynamically. I am using call by reference. Sometimes it works and sometimes it won't. In short, what I want to achieve is load VIs dynamically and close them dynamically once they finish executing. Thanks !
    Kudos always welcome for helpful posts

  • Trying to link a thumbnail in one frame to a larger image in another frame GOLIVE 9...

    Hi.
    I am using Adobe Golive 9.
    I found a tutorial on the internet that allows you to create an image gallery with clickable thumbnails
    http://www.tutorialhero.com/click-48179-create_an_image_gallery_with_clickable_thumbnails. php
    However, the tutorial is designed for a page without frames.
    I want to be able to do this using frames.
    I want to link a thumbnail on a page in one frame to a larger image on another page, so that when your mouse is over the thumbnail,
    the larger version appears in the other frame.
    This is what my frames look like so you get an idea of what I'm trying to do
    And here is a picture of the thumbnail in the lower frame and the larger image in the frame above it.
    Could someone please give me STEP BY STEP instructions on how to do this?  I'm new to Golive, using version GOLIVE 9, and I know this can be accomplished using "Set Image URL"  but have no idea how to do it.
    Thank you for your help all.
    Chris.

    A link in one frame is designed to call another page into some other frame, not an image. You can't use SetImageUrl across different pages. You'd probably have to put each of your large images on a page, and call each page each time. I'm not sure why you're so set on using frames, they have many disadvantages.

  • How can I Copy/paste the pixels within a frame in a video layer to another frame? (It duplicates the whole frame instead.)

    I'm making a handdrawn animation in the timeline using video layers, so each video layer contains the frames for the animation. The method works great..except for this -
    If lasso select a section of one frame and try to paste into another frame, it duplicates the the whole frame and pastes it with an arbitrary long frame duration for some reason (not the same duration as the frame its copied from)....not at all what I'm trying to do. Any work around? I've tried all the variations of 'paste special' to no avail.
    Thanks.

    Images and other object can either be floating or be inline. Yours are floating and will not move with the text. Inline object will move with the text but can't be outside the text layer. It doesn't help if you have created section in the document. Floating images doesn't care. Nor will it help if you create several documents that you want to merge later. Doesn't make any difference.
    My suggestion is that until your text is finished you have the images inline. Then as a last editing you can start make the images floating and move them a little.

  • 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..........
    }          

  • 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!!!!!!!!!!!!!!

  • Local Session Bean calling another local Session Bean in EJB 3.0

    Hi,
    In EJB 3.0, I am trying to do JNDI lookup of a local sesion bean from another session bean's helper class.
    I am not using @EJB injection mechanism here, as call to the local session bean is made in a helper class. Helper classes do not support resource injection.
    Following are the EJB class definitions used in my project. Call to "EJB3Local" made from "EJB1" fails as the "EJB2" helper class is calling "EJB1Local"
    @Stateless
    @EJBs({@EJB(name="EJB2Local", beanInterface=EJB2Local.class),
    @EJB(name="EJB3Local", beanInterface=EJB3Local.class)})
    public class EJB1 implements EJB1Remote, EJB1Local{
    public void findEJB3Local(){
    //1. JNDI lookup for EJB3Local ----
    //2. EJB3Local.someFunction()
    @Stateless
    @EJB(name="EJB1Local", beanInterface=EJB1Local.class)
    public class EJB2 implements EJB2Remote, EJB2Local{
    public void findEJB1Local(){
    //1. JNDI lookup EJB1Local
    // 2. Call EJB1Local.findEJB1Local method
    @Stateless
    public class EJB3 implements EJB3Remote, EJB3Local{
    public void someFunction(){}
    A remote call to EJB2.findEJB1Local() will invoke EJb1Local.findEJB3Local method and the call fails with "java:comp/env/EJB3Local" not found in EJB1Local.
    Has anybody encountered an issue like this issue with local interface calling another local interface?
    Thanks,
    Mohan

    To refer a Ejb from another Ejb include <ejb-ref> element
    in ejb-jar.xml
    <session>
    <ejb-name>SessionBeanA</ejb-name>
    <ejb-ref>
    <ejb-ref-name>SessionBeanB</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>com.ejb.SessionBeanBHome</home>
    <remote>com.ejb.SessionBeanB</remote>
    </ejb-ref>
    </session>
    Include a <reference-descriptor> in weblogic-ejb-jar.xml
    <weblogic-enterprise-bean>
    <ejb-name>SessionBeanA</ejb-name>
    <reference-descriptor>
    <ejb-reference-description>
    <ejb-ref-name>SessionBeanB</ejb-ref-name>
    <jndi-name>com.ejb.SessionBeanBHome</jndi-name>
    </ejb-reference-description>
    </reference-descriptor>
    </weblogic-enterprise-bean>
    In SessionBeanA Bean class refer to SessionBeanB with
    a remote reference to SessionBeanB.
    InitialContext initialContext=new InitialContext();
    SessionBeanBHome sessionBeanBHome=(SessionBeanBHome)
    initialContext.lookup("com.ejb.SessionBeanBHome");
    SessionBeanB sessionBeanB=sessionBeanBHome.findByPrimaryKey(primarykey);
    sessionBeanB.update();
    sessionBeanB.getAll();
    thanks,
    Deepak

  • Calling another web dynpro in a web dynpro programm

    Hi experts,
    I am new to web dynpro. And I am working on several web dynpro applications. I just want to know how to call another web dynpro within a web dynpro application. Don't use popups, I'd like the web dynpro work together in the same window just like a wizard.
    Thanks a lot.
    Guo Guo Qing
    Edited by: guoqing guo on Dec 24, 2007 6:59 AM

    Hi Guo,
    Yes, you can achieve it by Component Usage. You can embed other component's Interface views into your own Windows. Check out the component Usage information in help.sap.com to get a clear idea of it.
    Regards
    Raja Sekhar

  • Calling another function if upate statement fails

    Hi there,
    I have written an update procedure and insert procedure. Is there a way of calling another function if the update statement fails? Thanks a lot for your help.
    Chris
    procedure update_costing(in_period in DATE,
                   in_project_id IN VARCHAR2,
                   in_user_id IN VARCHAR2,
                   in_thu IN VARCHAR2,
                   in_fri IN VARCHAR2,
                   in_sat IN VARCHAR2,
                   in_sun IN VARCHAR2,
                   in_mon IN VARCHAR2,
                   in_tue IN VARCHAR2,
                   in_wed IN VARCHAR2)
         UPDATE TBL_COSTING
              SET
                   HOURS_THU = to_date (in_thu, 'HH24:MI'),
                   HOURS_FRI = to_date (in_fri, 'HH24:MI'),
                   HOURS_SAT = to_date (in_sat, 'HH24:MI'),
                   HOURS_SUN = to_date (in_sun, 'HH24:MI'),
                   HOURS_MON = to_date (in_mon, 'HH24:MI'),
                   HOURS_TUE = to_date (in_tue, 'HH24:MI'),
                   HOURS_WED = to_date (in_wed, 'HH24:MI'),
                   WHERE PERIOD = in_period
         AND PROJECT_ID = in_project_id
         AND USER_ID = in_user_id;
    EXCEPTION
    --CALLL HERE THE INSERT FUNCTION WITH SAME DATAMEMBERS
    SOMETHING LIKE THIS---
    WHEN others then
         insert_costing(in_period, in_project_id, in_user_id ,in_thu,in_fri,in_sat,in_sun,in_mon,in_tue,in_wed ,in_submit);
    COMMIT;
    END update_costing;

    begin
    UPDATE statement
    IF SQL%ROWCOUNT =0
    then
    INSERT statement|procedure
    end if;
    end;
    /Hi,
    i have a simple doubt over here, i read somewhere that cursor attributes can be used only as long as the cursor is open, then in the above case whiel doing the update operation, oracle implicitly will open an cursor and will do the operation and then will close the cursor, then how does SQL%ROWcount works???please revert...
    cheere

  • I want to send a response from the servlet and then call another servlet.

    Hi,
    I want to send a response from the servlet and then call another servlet. can this happen. Here is my scenario.
    1. Capture all the information from a form including an Email address and submit it to a servlet.
    2. Now send a message to the browser that the request will be processed and mailed.
    3. Now execute the request and give a mail to the mentioned Email.
    Can this be done in any way even by calling another servlet from within a servlet or any other way.
    Can any one Please help me out.
    Thanks,
    Ramesh

    Maybe that will help you (This is registration sample):
    1.You have Registration.html;
    2.You have Registration servlet;
    3.You have CheckUser servlet;
    4.And last you have Dispatcher between all.
    See the code:
    Registration.html
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>
      <HEAD>
        <TITLE>Hello registration</TITLE>
      </HEAD>
      <BODY>
      <H1>Entry</H1>
    <FORM ACTION="helloservlet" METHOD="POST">
    <LEFT>
    User: <INPUT TYPE="TEXT" NAME="login" SIZE=10><BR>
    Password: <INPUT TYPE="PASSWORD" NAME="password" SIZE=10><BR>
    <P>
    <TABLE CELLSPACING=1>
    <TR>
    <TH><SMALL>
    <INPUT TYPE="SUBMIT" NAME="logon" VALUE="Entry">
    </SMALL>
    <TH><SMALL>
    <INPUT TYPE="SUBMIT" NAME="registration" VALUE="Registration">
    </SMALL>
    </TABLE>
    </LEFT>
    </FORM>
    <BR>
      </BODY>
    </HTML>
    Dispatcher.java
    package mybeans;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.ServletException;
    import java.io.IOException;
    import javax.servlet.RequestDispatcher;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Dispatcher extends HttpServlet {
        protected void forward(String address, HttpServletRequest request,
                               HttpServletResponse response)
                               throws ServletException, IOException {
                                   RequestDispatcher dispatcher = getServletContext().
                                   getRequestDispatcher(address);
                                   dispatcher.forward(request, response);
    Registration.java
    package mybeans;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Registration extends Dispatcher {
        public String getServletInfo() {
            return "Registration servlet";
        public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            ServletContext ctx = getServletContext();
            if(request.getParameter("logon") != null) {          
                this.forward("/CheckUser", request, response);
            else if (request.getParameter("registration") != null)  {         
                this.forward("/registration.html", request, response);
    CheckUser.java
    package mybeans;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class CheckUser extends Dispatcher {
        Connection conn;
        Statement stat;
        ResultSet rs;
          String cur_UserName;
        public static String cur_UserSurname;;
        String cur_UserOtchestvo;
        public String getServletInfo() {
            return "Registration servlet";
        public void service(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            try{
                ServletContext ctx = getServletContext();
                Class.forName("oracle.jdbc.driver.OracleDriver");
                conn = DriverManager.getConnection("jdbc:oracle:oci:@eugenz","SYSTEM", "manager");
                stat = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
               String queryDB = "SELECT ID, Login, Password FROM TLogon WHERE Login = ? AND Password = ?";
                PreparedStatement ps = conn.prepareStatement(queryDB); 
               User user = new User();
            user.setLogin(request.getParameter("login"));
            String cur_Login = user.getLogin();
            ps.setString(1, cur_Login);
            user.setPassword(request.getParameter("password"));
            String cur_Password = user.getPassword();
            ps.setString(2, cur_Password);
         Password = admin");
            rs = ps.executeQuery();
                 String sn = "Zatoka";
            String n = "Eugen";
            String queryPeople = "SELECT ID, Surname FROM People WHERE ID = ?";
           PreparedStatement psPeople = conn.prepareStatement(queryPeople);
                      if(rs.next()) {
                int logonID = rs.getInt("ID");
                psPeople.setInt(1, logonID);
                rs = psPeople.executeQuery();
                rs.next();
                       user.setSurname(rs.getString("Surname"));
              FROM TLogon, People WHERE TLogon.ID = People.ID";
                       ctx.setAttribute("user", user);
                this.forward("/successLogin.jsp", request, response);
            this.forward("/registration.html", request, response);
            catch(Exception exception) {
    }CheckUser.java maybe incorrect, but it's not serious, because see the principe (conception).
    Main is Dispatcher.java. This class is dispatcher between all servlets.

  • Applet navigator to open a page in another frame.

    Hello to the Java gurus out there,
    I was wondering if someone could give me a pointer as to how I can get an applet navigator to open a page in another frame of the web browser?
    Say for example, I have two frames in the main HTML page where one frame contains an Applet navigator, and the other page can be loaded based on where the user clicks on the applet navigator.
    Capturing the mouse click event is all good, but then how do I load a page in another frame ??
    Any help would be much appreciated.
    J. Park

    In your applet class do the following
    getAppletContext().showDocument(new URL("somepage"), "Target");
    See the AppletContext class in http://java.sun.com/j2se/1.3/docs/api/index.html for more information.

  • How to detect end of FLV Video - and then call another web page?

    I'm using Flash CS3 v9 on a PC to...
    - use File > Import an AVI video and convert it to an FLV video.
    - use File > publish to publish it.
    - Then upload the four files...
    .. MyVideo.flv
    .. MyPage.html,
    .. MyPage swf
    .. AC_RunActiveContent.js
    to my website.
    Works Great!
    My Question:
    Since Javascript seems to run the .swf file which pays the .flv video... (or some such)
    Can I use Javascript (or html) to tell when the FLV Video has finished playing...
    And then automatically call another webpage...
    If so would someone be kind enough to share a code sample with me to get me quick started.
    Thanks for any help.

    I'm using the defaults in Flash CS3 ver9.
    I'm not creating any action script myself.
    I open Flash and select from the Flash menuio options...
    "Create New Flash File (Action Script 3.0)"
    I then File | Import my AVI video to convert it to an FLV video...
    and choose the player options for controls, etc
    and then punch through the menu's until Flash finally imports the video.
    I then "Publish" the project to the the 4 files mentioned in my initial posting.
    So, I think the answer to your question is...
    Yes, I'm using the default Flash playback component to play the flv
    and yes, I'm letting Flash default to CS3 even though I'm not writing the code... Flash is.
    Thanks for the help.

  • Web Service call to BPM to call another Web Service - all synch

    HI all,
    I have a webservice call to GetDocument from external system. In BPM I like to call another ws (SearchDocument) to retrieve metadata, which I need to complete the first GetDocument webservice. All synch if possible.
    Any idea how to achieve this with (or mayby without) BPM ??

    Thanks for your reply. Can you elaborate on that a bit more ?
    My first WS call is to get a document..but because I need to add some metadata in order to have a succesful call I need to call another WS first to the same system to get the required metadata. Then I need to use this metadata to complete the first - GetDocument- call....
    Hope this clarifies the scenario...
    Is it maybe possible to do this another way..in sequence..using response data to populate another ws call ??
    all help appreciated !
    cheers,

  • Calling another form

    hi guys
    can anyone please tell what what the best way is to call another form, pass a parameter to it e.g patient id and execute query on the form based the id passed. basically display all related data as you open that form
    thanks

    Check the on line help for CALL_FORM....its got an example.
    REgards
    Grant ROnald
    Forms Product Management

Maybe you are looking for