Swing program accessing oracle

this program does not give output when oracle is being accessed.... please help sks_bank is a table in oracle database having account number, name, balance
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.sql.*;
public class GridBagLoginDemo extends JFrame implements ActionListener
     JLabel l1,l2,l3,l4,l5;
     JTextField t1,t2,t3,t4;
     JButton b1,b2,b3;
     static Connection con;
     static Statement stat;
     static ResultSet result;
     public GridBagLoginDemo()
          super("The query application ");
          setLayout(new GridLayout(11,2));
          Color c=new Color(1,140,123);
          setBackground(c);
          l1=new JLabel("Account no:");
          l2=new JLabel("Amount:");
          l4=new JLabel("Balance:");
          l5=new JLabel("Name:");
          t1=new JTextField(20);
          t2=new JTextField(20);
          t3=new JTextField(20);
          t4=new JTextField(20);
          t3.setEditable(false);
          t4.setEditable(false);
          b2=new JButton("Balance");
          b1=new JButton("Deposit");
          b3=new JButton("Withdrawal");
          add(l1);add(t1);add(l2);add(t2);add(b1);add(b2);add(b3);add(l5);add(t4);add(l4);add(t3);          
          b1.addActionListener(this);
          b2.addActionListener(this);
          b3.addActionListener(this);
          pack();
          setVisible(true);
     public static void main(String a[])
          GridBagLoginDemo obj=new GridBagLoginDemo();
          try
               Class.forName("oracle.jdbc.driver.OracleDriver");
               con=DriverManager.getConnection("jdbc:oracle:thin:@topgun1:1521:topgun1", "scott", "tiger");
               System.out.println("sucess");
          catch(Exception e)
               System.out.println("could not execute the query"+e);
     }//close main method
     public void actionPerformed(ActionEvent a)
          try
               if(a.getSource( )==b2)
                    Statement stat=con.createStatement();
                    String squery="select * from sks_bank where acc_no=";
                    squery=squery+t1.getText();
                    System.out.println("the query is="+squery);
                    ResultSet result=stat.executeQuery(squery);
                    System.out.println("Acc_no U entered:"+t1.getText());
                    if(result != null )
                    System.out.println("result set not null");
                    while( result.next())
                    String s2=result.getString(2);
                    System.out.println("the result is="+s2);
                    System.out.println(result.getString(1)+"\t"+result.getString(2)+"\t"+result.getString(3));
                    }//close if loop
                    //result.next();
          catch(Exception e)
          System.out.println("exceception in query="+e);
Message was edited by:
sanjay_shaswani

String squery="select * from sks_bank where acc_no=";
squery=squery+t1.getText();shudder...
SQL injection attack heaven.
And who's for betting that the column is varchar instead of numeric?

Similar Messages

  • Need server to run swing program with oracle as back-end

    If I want to create a stand-alone program using swing and jdbc. What kind server I need?

    what do you mean distribute the application on the network? If it is a stand alone application then it is not a distributed application. Do you mean distributing the actual application to the users?

  • NoClassDefFoundError for Java Concurrent Program in Oracle Apps

    Hi,
    I am accessing the Oracle Apps application which is installed in local server(Within the network).
    I am trying to execute Java Concurrent Program in oracle apps (in Windows XP Professional). I did the following.
    1. Created the concurrent program executable with Execution file name
    as AvailableProg and Execution File Path as
    oracle.apps.fnd.cp.request (this is where AvailableProg resides)
    and Method as Java Concurrent Program.
    2. Created the concurrent program and set the Options as -cp JAVA_CON.
    3. Created a environment variable JAVA_CON (In Windows XP) with the
    values D:\apps.zip and
    D:\oracle.apps.fnd.cp.request.AvailableProg.class.
    4. Registered the concurrent program.
    5. While I submitted the request I got the following error:
    Exception in thread "main" java.lang.NoClassDefFoundError:
    oracle/apps/fnd/cp/request/Run.
    Can anybody help me in resolving this issue?
    Is there any documents available in executing java concurrent programs?
    Please do the needful..
    Thank You....

    Hi
    I am having the same issues. Here are the setup I have for all the variables:
    $ echo $AF_CLASSPATH
    /u001/oracle/deltacomn/util/jre/1.1.8/lib/rt.jar:/u001/oracle/deltacomn/util/jre/1.1.8/lib/i18n.jar:/u001/oracle/deltacomn/java/appsborg.zip:/u001/oracle/deltaora/8.0.6/forms60/java:/u001/oracle/deltacomn/java
    $ echo $JAVA_TOP
    /u001/oracle/deltacomn/java
    $ echo $AFJVAPRG
    /u001/oracle/deltacomn/util/jre/1.1.8/bin/jre
    $ echo $CLASSPATH
    /u001/oracle/deltacomn/util/jre/1.1.8/lib/rt.jar:/u001/oracle/deltacomn/util/jre/1.1.8/lib/i18n.jar:/u001/oracle/deltacomn/java/appsborg.zip:/u001/oracle/deltaora/8.0.6/forms60/java:/u001/oracle/deltacomn/java:/u001/oracle/deltaappl/ncr_custom/ncrx/1.0.0/java
    Please help.
    Thanks
    AE

  • How to access Oracle database using UNIX?

    Hi,
    Does anyone know how to access Oracle database Oracle 8i that is hosted on unix server via unix command line?
    Thanks,
    Willy

    Well, Oracle probably has a command line tool. I think it's called sqlplus or somesuch. Check you Oracle docs.
    Of course, given that this is a Java forum, it's remotely possible that you're actually asking about accessing the database from a Java program.
    http://java.sun.com/developer/onlineTraining/Database/JDBC20Intro/

  • Cann't access oracle 9i with thin jdbc and applet

    Hi..
    I write thin jdbc applet and application programs..
    application programs works well..
    but applet cann't connect...
    error messages below..
    access denied (java.util.PropertyPermission oracle.jserver.version read)
    web server and dbms server are on same machine...
    applet programs is in the demo applet program of oracle's installation folders...
    I hope your comment...
    thanks..

    Hi Hyun,
    This is basically just a guess -- since you didn't provide a lot of information (in my opinion) -- but I assume that "oracle.jserver.version" is some "System" property.
    Due to the security restrictions placed on an applet (and which aren't imposed on an application), an applet cannot access all of the "System" properties -- only some of them (like "java.version", for example). So that's why (I think) your application works, but your applet doesn't.
    There are several workarounds for overcoming an applet's security restrictions -- the most popular (as far as I know) is to "sign" your applet. There are many Internet resources available that explain how to "sign" an applet -- a simple Internet search will be more than enough to get you going (if that's at all relevant to your situation).
    Hope this has helped you.
    Good Luck,
    Avi.

  • [b]Unable to connect a Jdbc Program to Oracle database.[/b]

    Hi all,
    i am able to access Oracle database from server to my machine(client) without any connectivity of java.now,I am trying to connect my java program to Oracle database. i have no idea about any other driver.when i am trying to execute this code then it is showing fatal error: java.sql.SQLException: No suitable driver
         at java.sql.DriverManager.getConnection(Unknown Source)
    my code is here.if anyone is having idea then plz sort out it.
    Thanks n Regards,
    Abhi
    class Jdbc{   public static void main (String args [])throws SQLException, IOException{
    System.out.println ("Loading Oracle driver...");
         try {
         Class.forName ("sun.jdbc.odbc.JdbcOdbc");
           System.out.println("Driver Loaded!");}
         catch (ClassNotFoundException e) {
         System.out.println ("Could not load the driver");
         e.printStackTrace (); }
    System.out.println ("Connecting to the Oracle database...");
    String url = "Jdbc:Odbc:[email protected]:1521:rf","scott","tiger"
    //10.10.0.78 is oracle server IP address and rf is oracle instance.
    Connection conn = DriverManager.getConnection(url);

    Hi all,
    i am able to access Oracle database from server to my
    machine(client) without any connectivity of
    java.now,I am trying to connect my java program to
    Oracle database. i have no idea about any other
    driver.when i am trying to execute this code then it
    is showing fatal error: java.sql.SQLException: No
    suitable driver
    at java.sql.DriverManager.getConnection(Unknown
    n Source)
    my code is here.if anyone is having idea then plz
    sort out it.
    Thanks n Regards,
    Abhi
    class Jdbc{   public static void main (String args
    [])throws SQLException, IOException{
    System.out.println ("Loading Oracle driver...");
         try {
         Class.forName ("sun.jdbc.odbc.JdbcOdbc");
           System.out.println("Driver Loaded!");}
         catch (ClassNotFoundException e) {
         System.out.println ("Could not load the driver");
         e.printStackTrace (); }
    System.out.println ("Connecting to the Oracle
    database...");
    String url =
    "Jdbc:Odbc:[email protected]:1521:rf","scott","tiger"
    //10.10.0.78 is oracle server IP address and rf is
    oracle instance.
    Connection conn = DriverManager.getConnection(url);
    Hi , I dont know if u got the answer but couple of things i wanted to let u know.
    1. the driver u r using make it a thin driver as u r specifying that in the url .
    http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/winsoft.html
    loading class 'oracle.jdbc.driver.OracleDriver'
    and url u have to change a little, this depends on the driver u use.
    "jdbc:oracle:thin:@balrog:1521:testJdbc"
    Regards,
    Lakshmi Narayana
    /********************* the code which i have tested **************************/
    public class Jdbc {
         * @param args
         public static void main(String[] args)     throws SQLException, IOException{
                   System.out.println ("Loading Oracle driver...");
                        try {
                        Class.forName ("oracle.jdbc.driver.OracleDriver");
                        System.out.println("Driver Loaded!");}
                        catch (ClassNotFoundException e) {
                        System.out.println ("Could not load the driver");
                        e.printStackTrace (); }
                   System.out.println ("Connecting to the Oracle database...");
                   String url = "\"Jdbc:Odbc:[email protected]:1521:rf\",\"scott\",\"tiger\"";
    //               10.10.0.78 is oracle server IP address and rf is oracle instance.
                   Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@balrog:1521:testJdbc","ispsapp","ispsappbalrog");
                   Statement st = conn.createStatement();
                   ResultSet rs = st.executeQuery("select * from BC_PMT_APPLN");
                   if (rs.next()){
                        System.out.println("Column Count ="+rs.getMetaData().getColumnCount());
    }

  • Beginning Swing programming problem

    My classmates and I are trying to write a simple Swing program with a single button and a text field that contains the number of times the button has been pressed since the program started. The problem is that in the ActionPerformed method, any changes to the text field ends up with multiple event errors. It will print the count fine to the command prompt, but not the GUI. Any insight would be greatly appreciated.
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    class CounterGUI extends JFrame implements ActionListener
         public int count = 0;
         Container contents = getContentPane();
         JTextField counter;
         final String temp = "Total times pressed: ";
         public CounterGUI()
              final int width = 300;
              final int height = 300;
              setSize(width, height);
              JTextField counter = new JTextField(temp + count);
              counter.setEditable(false);
              JButton clicker = new JButton("Click me!");
              clicker.addActionListener(this);
              clicker.setActionCommand("Click");
              contents.add(counter, "Center");
              contents.add(clicker, "South");
         public void actionPerformed(ActionEvent e)
              String command = e.getActionCommand();
              if(command == "Click")
                   count++;
                   counter.setText(temp + count);     
                   System.out.println(count);
         public static void main(String[] args)
         JFrame f = new CounterGUI();
         f.addWindowListener(new WindowCloser());
              f.setVisible(true);

    Hi Guys,
    The line JTextField counter = new JTextField(temp + count); is declared in the constructor, this means that the field counter is not visible to other methods and you'll get a null pointer exception (NPE) when you try to access the class field counter
    Change to counter = new JTextField(temp + count); Now if you were catching and displaying exceptions you'd notice that this was happening.
    Dave

  • Cannot access Oracle PartnerNetwork Competency Center

    Hi,
    I'm OPN-member and was working with page without any promlem, BUT I get today following error. Was is wrong? How can I solve it?
    "We're sorry, an error occurred while accessing the Oracle PartnerNetwork Competency Center.
    You may have received this error message because your profile does not reflect complete information of your company as a member of Oracle PartnerNetwork (OPN). The OPN Competency Center is only accessible to Oracle Partners with a valid OPN membership.
    Not a member of OPN?
    Please follow the instructions to join the Oracle PartnerNetwork Program.
    Already a member of OPN?
    Please follow the instructions for OPN Portal/Partner Relationship Application access. As an Oracle Partner, your OPN profile has to reflect your company membership.
    In addition, you need to activate your Oracle University Knowledge Center (OUKC) account to access Oracle e-learning content library. For more details about how to create your OUKC account, please visit the "Account Related Queries" section in the Oracle University Knowledge Center Support page. Once this created, please use the same account details to access OPN Competency Center.
    After performing the above instructions, you should be able to access the training content from OPN Competency Center.
    If the OPN Competency Center access issue still persists, please contact your local Oracle Partner Business Center for further assistance.
    Learn More about Oracle PartnerNetwork
    Back to Previous Page. "

    889531 wrote:
    Hi,
    I'm OPN-member and was working with page without any promlem, BUT I get today following error. Was is wrong? How can I solve it?
    "We're sorry, an error occurred while accessing the Oracle PartnerNetwork Competency Center.
    You may have received this error message because your profile does not reflect complete information of your company as a member of Oracle PartnerNetwork (OPN). The OPN Competency Center is only accessible to Oracle Partners with a valid OPN membership.
    Not a member of OPN?
    Please follow the instructions to join the Oracle PartnerNetwork Program.
    Already a member of OPN?
    Please follow the instructions for OPN Portal/Partner Relationship Application access. As an Oracle Partner, your OPN profile has to reflect your company membership.
    In addition, you need to activate your Oracle University Knowledge Center (OUKC) account to access Oracle e-learning content library. For more details about how to create your OUKC account, please visit the "Account Related Queries" section in the Oracle University Knowledge Center Support page. Once this created, please use the same account details to access OPN Competency Center.
    After performing the above instructions, you should be able to access the training content from OPN Competency Center.
    If the OPN Competency Center access issue still persists, please contact your local Oracle Partner Business Center for further assistance.
    Learn More about Oracle PartnerNetwork
    Back to Previous Page. "To state the obvious ..... read this part of the message .....
    If the OPN Competency Center access issue still persists, please contact your local Oracle Partner Business Center for further assistance.*
    The running of the OPN website is independent of certification, and any issues of it need to be resolved via OPN, not Oracle Certification.
    ..... Also be aware it is seems normal for various Oracle Websites to be under maintenance at weekends, and they are often recovered and resume normal operation on mondays

  • Running Java on tru64 to access Oracle 9i

    Want to run a java program to access Oracle 9i on tru64 unix
    Can somebody guide us with a sample code,drives required & instalation.
    Thanks in advance

    These links would be a good start. Registration is required.
    http://otn.oracle.com/docs/tech/java/sqlj_jdbc/content.html
    http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/content.html
    Col

  • Permission required to access oracle client service names

    Hello,
    I  actually have a problem with accessing oracle client service names in Crystal.
    The problem is:
    I installed crystal reports 2008 and installed oracle client on a machine (I used an account that is a local administrator of the machine during installation) but the problem is that the users who are going to access crystal are standard users and they couldnu2019t access the services in oracle client and when they try to refresh the report they get the following error
    "Failed to load database information. Details: the DB connector 'crdb_oracle.dll' couldn't be loaded. the correct version of the database client for this database type might not be installed"
    I gave the users permission on the two folders (C:\program files \Common files \) and RegEdit : (C:\Windows \ System 32\) but the problem wasnu2019t solved so I made them local administrators and the problem was solved but I donu2019t want to make the users  local administrators on the machine , some people told me that I have to install oracle client with the user who will be using crystal but the problem is that two users will be working on the machine not just one and they have two different accounts and when I tried to give the users full control permission on oracle folder , the problem wasnu2019t solved, So I wanted to know if any one faced a similar problem and how to solve it without making the users local administrators.
    Thanks in advance.

    Hello,
    It appears you have everything installed and configured for Cr to work so it looks like it's a DB issue.
    What do you see in the logs if you enable logging on the Server? Are your requests even getting to the Server from CR under the user account?
    Test it using the admin and then the user account.
    You could try checking on the option to use Trusted Authentication in the database log on windows of CR. This should pass the users PC log on credentials to the Server.
    Thank you
    Don

  • ACCESSING ORACLE FROM ACCESS

    I CANT ACCESS ORACLE TABLES FROM MY ACCESS PROGRAM,,IT GIVES ME ERROR MESSAGES TNS, ODBC CONNECTION FAILED

    you have to create a data source name for oracle before trying to connect to the Oracle database. For this you have to go to Control Panel and open 32ODBC and create a System DSN if Oracle is on other machine or if it is on the same machine create User DSN.
    After creating this check the connectivity by opening the ODBC Test from
    start | Programs | Oracle for windows | Network
    after testing this you can specify the DSN name in your Access application and work on the Oracle database.
    I think this will help you ......
    Regards,
    Imran Hakeem

  • Error while accessing Oracle E-Business Suite 11i from Linux/firefox

    error while accessing Oracle E-Business Suite 11i from Linux/firefox
    OS: SUSE Linux Desktop 11(SLED11)
    Web browser: firefox 3.x
    Java versions:
    # rpm -qa |grep java
    java-1_6_0-sun-plugin-1.6.0.u18-0.1.1
    java-1_6_0-sun-1.6.0.u18-0.1.1
    # java -version
    java version "1.6.0_18"
    Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
    Java HotSpot(TM) Server VM (build 16.0-b13, mixed mode)
    when I access the url firefox says
    "Additional plugins are required to display all the media on this page"
    then I clicked on "Install Missing Plugin" button
    then I got the following message
    No Suitable Plugins were found
    Unknown Plugin (application/x-java-applet;jpi-version=1.4.1)
    please help/suggest
    Regards

    Hi user;
    Its not certified to login EBS from linux client
    Please check:
    Linux-cleint (ebs) certification
    pluggins
    Hope it helps
    Regard
    Helios

  • Keyboard-lock of swing program on Linux box

    We are developing swing program on Linux, and we often meet keyboard-lock issues.
    I try to simplify some of them to small programs, and still meet keyboard-lock.
    Here I post two programs to show the error:
    //---first ----------------------------------------------
    package test;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    public class KeyLock extends JFrame {
      JPanel contentPanel = new JPanel();
      JPanel wizardToolPan = new JPanel();
      JButton btnBack = new JButton("Back");
      JButton btnNext = new JButton("Next");
      JButton btnAbout = new JButton("About");
      public static final String aboutMsg =
              "<html>  This program will help to find keyboard lock problems, two way to reproduce:<br><br>" +
              "1 - press Alt+N to navigate next, and don't release keys untill there are no more next page, <br>" +
              "then try Alt+B to navigate back and also don't release keys untill page 0,<br>" +
              "repeat Alt+N and Alt+B again and again, keyboard will be locked during navigating. <br><br>" +
              "2 - press Alt+A in main window, it will popup an about dialog,<br>" +
              "then press down space key and don't release, <br>" +
              "the about dialog will be closed and opened again and again,<br>" +
              "keyboard will be locked sooner or later." +
              "</html>";
      public KeyLock() {
        this.setDefaultCloseOperation(EXIT_ON_CLOSE);
        this.setTitle("Keyboard lock test");
        getContentPane().setLayout(new BorderLayout());
        btnBack.setMnemonic('B');
        btnBack.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            KeyLock.this.goBack(e);
        btnNext.setMnemonic('N');
        btnNext.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            KeyLock.this.goNext(e);
        btnAbout.setMnemonic('A');
        btnAbout.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            JOptionPane.showMessageDialog(KeyLock.this, aboutMsg, "About", JOptionPane.INFORMATION_MESSAGE);
        contentPanel.setLayout(new BorderLayout());
        contentPanel.setPreferredSize(new Dimension(400, 250));
        contentPanel.setMinimumSize(new Dimension(400, 250));
        wizardToolPan.setLayout(new FlowLayout());
        wizardToolPan.add(btnBack);
        wizardToolPan.add(btnNext);
        wizardToolPan.add(btnAbout);
        this.getContentPane().add(contentPanel, java.awt.BorderLayout.CENTER);
        this.getContentPane().add(wizardToolPan, java.awt.BorderLayout.SOUTH);
        this.setSize(400, 300);
        this.createContentPanels();
        this.showCurrent();
      private Vector<JPanel> slides = new Vector<JPanel>();
      private int current = 0;
      private void createContentPanels() {
        for (int j = 0; j < 20; ++j) {
          JPanel p = new JPanel(new FlowLayout());
          p.add(new JLabel("Page: " + j));
          p.add(new JTextField("Page: " + j + ", input something here", 20));
          p.add(new JTextField("Page: " + j + ", input something here", 20));
          p.add(new JTextField("Page: " + j + ", input something here", 20));
          p.add(new JLabel("Input something in password box:"));
          p.add(new JPasswordField(20));
          p.add(new JCheckBox("Try click here, focus will be here."));
          p.add(new JRadioButton("Try click here, focus will be here."));
          slides.add(p);
      public void showCurrent() {
        if (current < 0 || current >= slides.size())
          return;
        JPanel p = slides.get(current);
        this.contentPanel.add(p, java.awt.BorderLayout.CENTER);
        this.pack();
        Component[] comps = p.getComponents();
        if (comps.length > 0) {
          comps[0].requestFocus(); // try delete this line
        this.repaint();
      public void goNext(ActionEvent e) {
        if (current + 1 >= slides.size())
          return;
        this.contentPanel.remove(slides.get(current));
        current++;
        sleep(100);
        this.showCurrent();
      public void goBack(ActionEvent e) {
        if (current <= 0)
          return;
        this.contentPanel.remove(slides.get(current));
        current--;
        sleep(100);
        this.showCurrent();
      public static void sleep(int millis) {
        try {
          Thread.sleep(millis);
        } catch (Exception e) {
          e.printStackTrace();
      public static void main(String[] args) {
        KeyLock wizard = new KeyLock();
        wizard.setVisible(true);
    }The first program will lead to keyboard-lock in RHEL 4 and red flag 5, both J2SE 5 and 6.
    //---second -----------------------------------------
    package test;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class KeyFocusLost extends JFrame {
      private JButton btnPopup = new JButton();
      private JTextField jTextField1 = new JTextField();
      private JPasswordField jPasswordField1 = new JPasswordField();
      private JPanel jPanel1 = new JPanel();
      private JScrollPane jScrollPane3 = new JScrollPane();
      private JTree jTree1 = new JTree();
      private JButton btnAbout = new JButton("About");
      public static final String aboutMsg =
              "<html>  This program is used to find keyboard focus lost problem.<br>" +
              "Click 'popup' button in main window, or select any node in the tree and press F6,<br>" +
              "a dialog popup, and click ok button in the dialog,<br>" +
              "keyboard focus will lost in main window." +
              "</html>";
      public KeyFocusLost() {
        this.setDefaultCloseOperation(EXIT_ON_CLOSE);
        this.setTitle("Keyboard focus test");
        getContentPane().setLayout(null);
        btnPopup.setBounds(new Rectangle(33, 482, 200, 35));
        btnPopup.setMnemonic('P');
        btnPopup.setText("Popup and lost focus");
        btnPopup.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            PopupDialog dlg = new PopupDialog(KeyFocusLost.this);
            dlg.setVisible(true);
        btnAbout.setBounds(new Rectangle(250, 482, 100, 35));
        btnAbout.setMnemonic('A');
        btnAbout.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            JOptionPane.showMessageDialog(KeyFocusLost.this, aboutMsg, "About", JOptionPane.INFORMATION_MESSAGE);
        jTextField1.setText("Try input here, and try input in password box below");
        jTextField1.setBounds(new Rectangle(14, 44, 319, 29));
        jPasswordField1.setBounds(new Rectangle(14, 96, 319, 29));
        jPanel1.setBounds(new Rectangle(14, 158, 287, 291));
        jPanel1.setLayout(new BorderLayout());
        jPanel1.add(new JLabel("Select any node in the tree and press F6."), java.awt.BorderLayout.NORTH);
        jPanel1.add(jScrollPane3, java.awt.BorderLayout.CENTER);
        jScrollPane3.getViewport().add(jTree1);
        Object actionKey = "popup";
        jTree1.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_F6, 0), actionKey);
        jTree1.getActionMap().put(actionKey, new AbstractAction() {
          public void actionPerformed(ActionEvent e) {
            PopupDialog dlg = new PopupDialog(KeyFocusLost.this);
            dlg.setVisible(true);
        this.getContentPane().add(jTextField1);
        this.getContentPane().add(jPasswordField1);
        this.getContentPane().add(jPanel1);
        this.getContentPane().add(btnPopup);
        this.getContentPane().add(btnAbout);
      public static void main(String[] args) {
        KeyFocusLost keytest = new KeyFocusLost();
        keytest.setSize(400, 600);
        keytest.setVisible(true);
      static class PopupDialog extends JDialog {
        private JButton btnOk = new JButton();
        public PopupDialog(Frame owner) {
          super(owner, "popup dialog", true);
          setDefaultCloseOperation(DISPOSE_ON_CLOSE);
          this.getContentPane().setLayout(null);
          btnOk.setBounds(new Rectangle(100, 100, 200, 25));
          btnOk.setMnemonic('O');
          btnOk.setText("OK, then focus lost");
          btnOk.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              PopupDialog.this.getOwner().toFront();
              try {
                Thread.sleep(100); // try delete this line !!!
              } catch (Exception ex) {
                ex.printStackTrace();
              PopupDialog.this.dispose();
          this.getContentPane().add(btnOk);
          this.getRootPane().setDefaultButton(btnOk);
          this.setSize(400, 300);
    }The second program will lead to keyboard-focus-lost in RHEL 3/4 and red flag 4/5, J2SE 5, not in J2SE 6.
    And I also tried java demo program "SwingSet2" in red flag 5, met keyboard-lock too.
    I guess it should be some kind of incompatibleness of J2SE with some Linux platform. Isn't it?
    Please help, thanks.

    Hi.
    I have same problems on Ubuntu with Java 6 (all versions). I would like to use NetBeans or IntelliJ IDEA but it is not possible due to keyboard locks.
    I posted this bug
    https://bugs.launchpad.net/ubuntu/+bug/174281
    before I found some info about it:
    http://forums.java.net/jive/thread.jspa?messageID=189281
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6506617
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6568693
    I don't know from which part this bug comes, but I wonder why it isn't fixed yet. Does anybody else use NetBeans or IntelliJ IDEA on linux with Java 6 ?
    (I cannot insert link :\ )

  • PL/Sql concurent program in Oracle 10.7

    Hi
    I am creating a PL/SQL concurrent program in Oracle version 10.7. I need to write some messages to the log file. I know this can easily be done in 11i using FND_FILE.
    In 10.7, I am trying to use UTL_FILE. I get the logfile name from FND_CONCURRENT_REQUESTS using following cursor:
    SELECT logfile_name
    FROM fnd_concurrent_requests
    WHERE request_id = fnd_global.conc_request_id;
    This gives the correct name, when i try to open the file for writing after parsing, i get an error. The system is not able to open the file in Append mode, when i open the file in read mode, it does not give any errors.
    Same is the case for the outfile as well.
    Is it possible to write to the log file in 10.7. I used the append mode, since the concurrent manager also write to the same file.
    Any pointers ?
    thanks and regards

    utl_file_dir = * --> This is valid and can be used, but its not recommended to use it since it makes any directory accessible to the UTL_FILE function. Instead use utl_file_dir = path1, path2, .. etc (use an absolute directory path).
    I am not sure about 10.7, but for 11.0.x you have to verify that APPLPTMP is included in the setting of the utl_file_dir. Once you change this, restart the concurrent manager and make sure that the user who start the CM has read/write priviliges on APPLPTMP and utl_file_dir.
    You can verify that the PL/SQL runs properly for reading/writing from/to utl_file_dir from SQL*Plus

  • Error while running Swing program on FreeBSD

    Hi,
    I am trying to run simple swing program "helloworld"
    but while executing it gives following error on FreeBSD
    Exception in thread "main" java.lang.UnsatisfiedLinkError:
    /usr/local/linux-sun-jdk1.4.2/jre/lib/i386/libawt.so: libXp.so.6:
    cannot open shared object file: No such file or directory
            at java.lang.ClassLoader$NativeLibrary.load(Native Method)
            at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560)
            at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477)
            at java.lang.Runtime.loadLibrary0(Runtime.java:788)
            at java.lang.System.loadLibrary(System.java:834)
            at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
            at java.security.AccessController.doPrivileged(Native Method)
            at sun.awt.NativeLibLoader.loadLibraries(NativeLibLoader.java:38)
            at sun.awt.DebugHelper.<clinit>(DebugHelper.java:29)
            at java.awt.EventQueue.<clinit>(EventQueue.java:80)
            at javax.swing.SwingUtilities.invokeLater(SwingUtilities.java:1170)
            at JPanels.main(JPanels.java:29)
    Should i install XFree86-libs package on FreeBsd
    configuration
    FreeBSD 4.10-BETA (GENERIC)
    I am using following packages
    linux-sun-jdk-1.4.2.04 Sun Java Development Kit 1.4 for Linux
    linux_base-8-8.0_4 Base set of packages needed in Linux mode (only for i386)
    linux_devtools-8.0_1 Packages needed for doing development in Linux mode
    libtool-1.3.5_1 Generic shared library support script
    gmake-3.80_1 GNU version of 'make' utility
    automake-1.4.5_9 GNU Standards-compliant Makefile generator (legacy version
    GCC 2.95.4
    gdb 4.18
    ld 2.12.1 supported emulation elf_i386
    regards
    Man479

    This is not really a Swing question. You should install the library which satisfies the lookup of libXp.so.6 .
    I quess the jre for this platform is compiled against this version. Looks to me like some X related library, maybe google can resolve a solution/package to install?
    Greetz

Maybe you are looking for

  • Formula is not working properly

    Hello Friends, I have a simple problem and I couldn't get through with this. I am doing a simple calculation in the formula .. Here it is --- Actual Quantity / Forecast quantity  If it 1/0 , it is displaying 22.33 , 24/6 = 89.87 etc Someone please te

  • How can I create a bootable DISK IMAGE of my PB Internal Drive?

    I would like to make a bootable image of my Hard Drive but without including any Free Space. You see all I need on the image are the OSX and the programs, NOT the 60GB of Free Space. Disk Utility however wants to create a 80gb image which includes 60

  • Data extracting to BW from R3 taking too much time

    Hi, We have one delta data load to ODS from R3 this is taking 4-5 hours .this job runs in r3 itself for 4-5 hours even for 30-40 records.and after this ODS data updated to cube so but since in ODS itself takes too much time so delta brings 0 records

  • Applet Servlet communication (urgent)

    Hi, I m using Netscape Enterrpise server 4.0 as my web server. I am passing data from applet to servlet using BufferedInputStream(). But it takes about 30 seconds to send the data. If i don't use it, the data is not being read by the servlet. Is ther

  • HT1541 HI my itune code is not active how do i go about it

    can you let me know how to go about it please