Is there a OracleDataReader hasNext() method?

Hi all!
How can I see if I have a register to read without moving the cursor?
OracleDataReader o = ...;
Instead of doing "o.Read()" do something like "o.hasNext()"?
Is there a way to do this?
Best Regards,

Are you looking for o.HasRows to check whether the reader has one or more rows, instead of doing "o.Read()"?
ODP.NET 10.1.0.3 OracleDataReader has the property.

Similar Messages

  • My iPad camera photos will wirelessly sync with my iMac and iCLoud photo stream, but the videos do not, is USB connection the only way to transfer videos or is there also a wireless method?

    My iPad camera photos will wirelessly sync with my iMac and iCLoud photo stream, but the videos do not, is USB connection the only way to transfer videos or is there also a wireless method?

    Videos are not included with the Photo Stream. Photo Stream is for photos only.
    There is not a wireless method for importing videos from the iPad's Camera Roll.

  • I want to change my account payment method to none and I do not have a credit card yet.Plus, iTunes gave a message saying that I need to review my account and when I go there,the none payment method is hidden.

    I want to change my account payment method to none and I do not have a credit card yet.Plus, iTunes gave a message saying that I need to review my account and when I go there,the none payment method is hidden.

    Assuming that you want help and that you aren't just copying-and-pasting that thread's title and posting a link to it, then have you tried the steps on the post that I linked to in my first reply on that thread ?
    If you don't get the 'none' option when trying those instructions then you will need to enter credit card details before you will be able to use the account - when you've entered credit card details you should get the 'none' option and be able to remove your card details.
    Or you can create a new account, and follow, exactly, the steps on this page when creating it' : http://support.apple.com/kb/HT2534

  • Is there a Function or Method to automaticaly generate passwords?

    hi there,
    is there a Function or Method which generates passwords?

    Check the below sample code paste and check in SE38
    data lv_genpassword type char08.
    CALL FUNCTION 'RSEC_GENERATE_PASSWORD'
    EXPORTING
       ALPHABET                   = '0123456789ABCDEFGHIJKNPQRSTUVXYZ'
       ALPHABET_LENGTH            = 36
       OUTPUT_LENGTH              = 8
    IMPORTING
       OUTPUT                     = lv_genpassword
    EXCEPTIONS
       SOME_ERROR                 = 1
       OTHERS                     = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    else.
       write lv_genpassword.
    ENDIF.
    Kanagaraja L
    Edited by: Kanagaraja  Lokanathan on Sep 3, 2009 2:36 PM

  • There are two CDC methods - Source based CDC and Target based CDC which one

    There are two CDC methods - Source based CDC and Target based CDC, which one is better performancewise. in data services.
    If there is any document available which compares both and provides any info on performance etc, will be helpful.
    thank you for the helpful info.

    LIke Suneer mentioned CDC is for better performance.
    Following link would be helpful.
    http://wiki.sdn.sap.com/wiki/display/BOBJ/Extractors-Source-Based+CDC
    http://wiki.sdn.sap.com/wiki/display/BOBJ/Extractors-Target-Based+CDC
    Thanks,
    Arun

  • Was there a change in method names for ABAP Proxies ???

    Hi all,
    i am wondering if there was a change in the method names when using ABAP proxies.
    In my projects there were always the methods execute_synchronous and execute_asynchronous when generating proxies.
    In a current project i created some ABAP proxies and the method names are not the same any longer. Now the method takes the name of the Message interface. I observed this in Backendsystems NW2004s (Basis 7.0) with SP14 and 15. It seems that it has changed since the sproxy was integrated in SE80.
    Can anybody tell me, how i can use the "old" method names again when generating proxies ?
    Best regards,
    martin

    Actually i guess they did in more SOA way. If u see it says connecting to ESR rather than integration repository.
    Yes. In order to allow several operations for a message interface, the methods of the ABAP proxies get the operation name as method instead of a constant (the Java proxies alwas had this behaviour).
    could u pl highlight what other operations are allowed on message interface rather than sending a message to the XI either in synchronous or asynchronous manner?
    Thanks and Regards
    Rajeev Patkie

  • Why there are overloaded create methods in Statful bean?

    Hi all,
    I have a question ...!
    Why there are overloaded create methods for Statefule beans? and why not for Stateless bean?
    because any way these create methods are for giving referneces of EJB objects.hence, what is use of overloaded methods in stateful bean?
    Thanks in advance.
    Regards,
    Rahul

    Hi Rahul,
    Each stateful session bean is tied to a particular client. That means whatever state is passed in during create() is guaranteed
    to be available on subsequent invocations. Allowing multiple create methods is a convenience.
    For stateless session beans there is no prescribed relationship between the caller and which bean instance is used to handle
    an invocation. It wouldn't make sense to allow creation parameters since there would be no guarantee that a subsequent
    invocation is handled by an instance containing that particular initialization state.
    All of this only applies to the EJB 2.1 and earlier API. Starting in EJB 3.0, there are no longer explicit create() methods.
    As you've seen there isn't any benefit to having them in the stateless case. For stateful session beans in EJB 3.0, the
    developer can perform initialization by just declaring a particular business method and calling that after first acquiring a
    new stateful session bean reference.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • If there are two synchronized methods in one class.

    If there are two synchronized methods in one class then what will be the beheviour of the threads accessing the methods.

    Synchronization is on objects, not methods or classes. A thread, entering a synchronized method, synchronizes on the object on which that method is called. Another thread, attempting to synchronize on that object, will be made to wait until the first thread releases it.

  • Is there a standard approved method of transferring your itunes library from an old computer (windows vista) to a new one (will almost certainly be Windows 7)?

    Is there a standard approved method of transferring your itunes library from an old pc (windows Vista) to a new one (almost certainly Windows 7)? I can't find anything on the standard Apple websites.
    If not, how do people do it generally?

    Type " move itunes library" into the google search bar.

  • IS THERE ANY FUNCTION OR METHOD TO KNOW CURRENT OPERATIN SYS

    Hi,
    is there any function or method to know current operating system where peoplecode is runnig or any system variable
    thanks,
    Amit

    CTRL + J displays the operating system.
    In terms of the code that does this, as discussed in this article:
    http://www.peoplesoftwiki.com/limit-control-j-information
    You can look at the PT_INFOPAGECONNECT HTML definition which uses the system variable %BrowserPlatform to show this information.
    According to PeopleBooks, this system variable resolves to:
    At runtime %BrowserPlatform is replaced with the operating system name as specified by the browser loading the current page.

  • Adding a JButton when there's a paint method

    I'm creating a game application, sort of like a maze, and I want to add buttons to the levelOne panel to be able to move around the maze. When I add the buttons to the panel they don't appear, I assume the paint method is the reason for this. here's my code, I have 3 files, ill post the user_interface, and the levels class, where the level is created and where i tried to add the button. I tried putting the buttons in a JOptionPane, but then my JMenu wouldn't work at the same time the OptionPane was opened. If anyone knows a way around this instead, please let me know. I also tried using a separate class with a paintComponent method in it, and then adding the button (saw on a forum, not sure if it was this one), but that didn't work either. Also, if there is a way just to simply have the user press the directional keys on the keyboard and have the program perform a certain function when certain keys are pressed, I'd like to know, as that would solve my whole problem. Thanks.
    //Libraries
    import java.awt.*;
    import java.io.*;
    import java.util.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.text.*;
    public class User_Interface extends JFrame
    static Levels l = new Levels ();
    static Delay d = new Delay ();
    private Container contentPane = getContentPane ();
    private JPanel main, levelOne;
    private String level;
    private CardLayout cc = new CardLayout ();
    private GridBagConstraints gbc = new GridBagConstraints ();
    private JPanel c = new JPanel ();
    private String label = "MainMenu";
    public User_Interface ()
    //Generates the User-Interface
    super ("Trapped");
    main = new JPanel ();
    GridBagLayout gbl = new GridBagLayout ();
    main.setLayout (gbl);
    c.setLayout (cc);
    // set_gbc (gbc, 2, 2, 5, 5, GridBagConstraints.NONE);
    c.add (main, "Main Page");
    contentPane.add (c, BorderLayout.CENTER);
    cc.show (c, "Main Page");
    levelOne = new JPanel ();
    levelOne.setLayout (new GridBagLayout ());
    levelOne.setBackground (Color.black);
    c.add (levelOne, "LevelOne");
    JMenuBar menu = new JMenuBar ();
    JMenu file = new JMenu ("File");
    JMenu help = new JMenu ("Help");
    JMenuItem about = new JMenuItem ("About");
    JMenuItem mainmenu = new JMenuItem ("Main Menu");
    mainmenu.addActionListener (
    new ActionListener ()
    public void actionPerformed (ActionEvent event)
    cc.show (c, "Main Page");
    label = "MainMenu";
    JMenuItem newGame = new JMenuItem ("New Game");
    newGame.addActionListener (
    new ActionListener ()
    public void actionPerformed (ActionEvent event)
    l.xCord = 2;
    l.yCord = 2;
    l.xLoc = 140;
    l.yLoc = 140;
    JPanel entrance = new JPanel ();
    entrance.setLayout (new FlowLayout ());
    c.add (entrance, "Entrance");
    label = "Entrance";
    level = "ONE";
    cc.show (c, "Entrance");
    JMenuItem loadgame = new JMenuItem ("Load Game");
    JMenuItem savegame = new JMenuItem ("Save Game");
    JMenuItem exit = new JMenuItem ("Exit");
    exit.addActionListener (
    new ActionListener ()
    public void actionPerformed (ActionEvent event)
    JFrame frame = new JFrame ();
    frame.setLocation (10, 10);
    JOptionPane.showMessageDialog (frame, "Come Back Soon!", "TRAPPED", JOptionPane.INFORMATION_MESSAGE);
    System.exit (0);
    file.add (about);
    file.add (mainmenu);
    file.add (newGame);
    file.add (loadgame);
    file.add (savegame);
    file.add (exit);
    menu.add (file);
    menu.add (help);
    setJMenuBar (menu);
    //Sets the size of the container (columns by rows)
    setSize (750, 550);
    //Sets the location of the container
    setLocation (10, 10);
    //Sets the background colour to a dark blue colour
    main.setBackground (Color.black);
    //Makes the container visible
    setVisible (true);
    public void paint (Graphics g)
    super.paint (g);
    g.setColor (Color.white);
    if (label == "MainMenu")
    for (int x = 0 ; x <= 50 ; ++x)
    g.setColor (Color.white);
    g.setFont (new Font ("Arial", Font.BOLD, x));
    g.drawString ("T R A P P E D", 100, 125);
    d.delay (10);
    if (x != 50)
    g.setColor (Color.black);
    g.drawString ("T R A P P E D", 100, 125);
    if (label == "Entrance")
    l.Entrance ("ONE", g);
    label = "LevelOne";
    if (label == "LevelOne")
    l.LevelOne (g, levelOne, gbc);
    label = "";
    public static void main (String[] args)
    // calls the program
    User_Interface application = new User_Interface ();
    application.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
    } //End of Main Method
    //Libraries
    import java.awt.*;
    import java.io.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class Levels extends Objects
    private JFrame frame = new JFrame ();
    //Sets location, size, and visiblity to the frame where the JOptionPane
    //will be placed
    frame.setLocation (600, 600);
    frame.setSize (1, 1);
    frame.setVisible (false);
    public int xCord = 2;
    public int yCord = 2;
    public void LevelOne (Graphics g, JPanel one, GridBagConstraints gbc)
    ***Trying to add the button, doesn't appear. Tried adding to the container, and any JPanel i had created***
    JButton button1 = new JButton ("TEST");
    one.add (button1);
    g.setColor (Color.white);
    g.fillRect (500, 100, 200, 300);
    g.setColor (Color.black);
    g.drawRect (500, 100, 200, 300);
    g.setFont (new Font ("Verdana", Font.BOLD, 25));
    g.setColor (Color.black);
    g.drawString ("LEVEL ONE", 525, 80);
    //ROW ONE
    counter = -80;
    counter2 = 200;
    for (int a = 1 ; a <= 7 ; ++a)
    if (xCord < a && yCord == 0)
    g.setColor (darkGray);
    g.fillRect (xLoc + counter, yLoc - 80, 40, 40);
    g.setColor (Color.black);
    g.drawRect (xLoc + counter, yLoc - 80, 40, 40);
    if (xCord > a - 1 && yCord == 0)
    g.setColor (darkGray);
    g.fillRect (xLoc + counter2, yLoc - 80, 40, 40);
    g.setColor (Color.black);
    g.drawRect (xLoc + counter2, yLoc - 80, 40, 40);
    counter += 40;
    counter2 += 40;
    *****Theres 9 more rows, just edited out to save space****
    int y = 100;
    int x = 100;
    for (int a = 0 ; a < 20 ; ++a)
    g.setColor (Color.white);
    g.fillRoundRect (x, y, 40, 40, 5, 5);
    g.setColor (Color.black);
    g.drawRoundRect (x, y, 40, 40, 5, 5);
    y += 40;
    if (a == 9)
    x += 320;
    y = 100;
    x = 140;
    y = 100;
    for (int a = 0 ; a < 14 ; ++a)
    g.setColor (Color.white);
    g.fillRoundRect (x, y, 40, 40, 5, 5);
    g.setColor (Color.black);
    g.drawRoundRect (x, y, 40, 40, 5, 5);
    x += 40;
    if (a == 6)
    x = 140;
    y += 360;
    g.setColor (Color.black);
    g.drawRect (100, 100, 360, 400);
    ImageIcon[] images = new ImageIcon [4];
    images [0] = new ImageIcon ("arrow_left.gif");
    images [1] = new ImageIcon ("arrow_up.gif");
    images [2] = new ImageIcon ("arrow_down.gif");
    images [3] = new ImageIcon ("arrow_right.gif");
    int direction = -1;
    *****This is where I tried to have the OptionPane show the directional buttons******
    //frame.setVisible (true);
    // direction = JOptionPane.showOptionDialog (frame, "Choose Your Path:", "Trapped", JOptionPane.YES_NO_CANCEL_OPTION,
    // JOptionPane.QUESTION_MESSAGE,
    // null,
    // images,
    // images [3]);
    // if (direction == 0)
    // if (xCord - 1 > 0)
    // xCord -= 1;
    // xLoc += 40;
    // if (direction == 1)
    // if (yCord - 1 > 0)
    // yCord -= 1;
    // yLoc += 40;
    // if (direction == 2)
    // if (yCord + 1 < 9)
    // yCord += 1;
    // yLoc -= 40;
    // if (direction == 3)
    // if (xCord + 1 < 13)
    // xCord += 1;
    // xLoc -= 40;
    //LevelOne (g, one, gbc);
    }

    i tried adding a keylistener, that didn't work too well, i had tried to add it to a button and a textarea which i added to the 'one' frame, it didn't show up, and it didn't work. How would i go about changing the paint method so that it doesn't contain any logic? That's the only way I could think of getting the program to move forward in the game. Thanks.
    //Libraries
    import java.awt.*;
    import java.io.*;
    import java.util.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.text.*;
    public class User_Interface extends JFrame
        static Levels l = new Levels ();
        static Delay d = new Delay ();
        private Container contentPane = getContentPane ();
        private JPanel main, levelOne;
        private String level;
        private CardLayout cc = new CardLayout ();
        private GridBagConstraints gbc = new GridBagConstraints ();
        private JPanel c = new JPanel ();
        private String label = "MainMenu";
        public User_Interface ()
            //Generates the User-Interface
            super ("Trapped");
            main = new JPanel ();
            GridBagLayout gbl = new GridBagLayout ();
            main.setLayout (gbl);
            c.setLayout (cc);
            // set_gbc (gbc, 2, 2, 5, 5, GridBagConstraints.NONE);
            c.add (main, "Main Page");
            contentPane.add (c, BorderLayout.CENTER);
            cc.show (c, "Main Page");
            levelOne = new JPanel ();
            levelOne.setLayout (new GridBagLayout ());
            levelOne.setBackground (Color.black);
            c.add (levelOne, "LevelOne");
            JMenuBar menu = new JMenuBar ();
            JMenu file = new JMenu ("File");
            JMenu help = new JMenu ("Help");
            JMenuItem about = new JMenuItem ("About");
            JMenuItem mainmenu = new JMenuItem ("Main Menu");
            mainmenu.addActionListener (
                    new ActionListener ()
                public void actionPerformed (ActionEvent event)
                    cc.show (c, "Main Page");
                    label = "MainMenu";
            JMenuItem newGame = new JMenuItem ("New Game");
            newGame.addActionListener (
                    new ActionListener ()
                public void actionPerformed (ActionEvent event)
                    l.xCord = 2;
                    l.yCord = 2;
                    l.xLoc = 140;
                    l.yLoc = 140;
                    JPanel entrance = new JPanel ();
                    entrance.setLayout (new FlowLayout ());
                    c.add (entrance, "Entrance");
                    label = "Entrance";
                    level = "ONE";
                    cc.show (c, "Entrance");
            JMenuItem loadgame = new JMenuItem ("Load Game");
            JMenuItem savegame = new JMenuItem ("Save Game");
            JMenuItem exit = new JMenuItem ("Exit");
            exit.addActionListener (
                    new ActionListener ()
                public void actionPerformed (ActionEvent event)
                    JFrame frame = new JFrame ();
                    frame.setLocation (10, 10);
                    JOptionPane.showMessageDialog (frame, "Come Back Soon!", "TRAPPED", JOptionPane.INFORMATION_MESSAGE);
                    System.exit (0);
            file.add (about);
            file.add (mainmenu);
            file.add (newGame);
            file.add (loadgame);
            file.add (savegame);
            file.add (exit);
            menu.add (file);
            menu.add (help);
            setJMenuBar (menu);
            //Sets the size of the container (columns by rows)
            setSize (750, 550);
            //Sets the location of the container
            setLocation (10, 10);
            //Sets the background colour to a dark blue colour
            main.setBackground (Color.black);
            //Makes the container visible
            setVisible (true);
        public void paint (Graphics g)
            super.paint (g);
            g.setColor (Color.white);
            if (label == "MainMenu")
                for (int x = 0 ; x <= 50 ; ++x)
                    g.setColor (Color.white);
                    g.setFont (new Font ("Arial", Font.BOLD, x));
                    g.drawString ("T    R    A    P    P    E    D", 100, 125);
                    d.delay (10);
                    if (x != 50)
                        g.setColor (Color.black);
                        g.drawString ("T    R    A    P    P    E    D", 100, 125);
            if (label == "Entrance")
                l.Entrance ("ONE", g);
                label = "LevelOne";
            if (label == "LevelOne")
                l.LevelOne (g, levelOne, gbc);
                label = "";
            //g.setColor (new Color
        public static void main (String[] args)
            // calls the program
            User_Interface application = new User_Interface ();
            application.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
        } //End of Main Method
    //Libraries
    import java.awt.*;
    import java.io.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.ActionMap;
    import javax.swing.plaf.*;
    public class Levels extends Objects
        implements KeyListener
        //static final String newline = System.getProperty ("line.separator");
        JButton button;
        private JFrame frame = new JFrame ();
            //Sets location, size, and visiblity to the frame where the JOptionPane
            //will be placed
            frame.setLocation (600, 600);
            frame.setSize (1, 1);
            frame.setVisible (false);
        JButton button1;
        public int xCord = 2;
        public int yCord = 2;
        public void LevelOne (Graphics g, JPanel one, GridBagConstraints gbc)
        //    button = new JButton ("TEST");
        //    ButtonHandler handler = new ButtonHandler ();
         //   button.addActionListener (handler);
          //  one.add (button);
            g.setColor (Color.white);
            g.fillRect (500, 100, 200, 300);
            g.setColor (Color.black);
            g.drawRect (500, 100, 200, 300);
            g.setFont (new Font ("Verdana", Font.BOLD, 25));
            g.setColor (Color.black);
            g.drawString ("LEVEL ONE", 525, 80);
            //ROW ONE
            counter = -80;
            counter2 = 200;
            for (int a = 1 ; a <= 7 ; ++a)
                if (xCord < a && yCord == 0)
                    g.setColor (darkGray);
                    g.fillRect (xLoc + counter, yLoc - 80, 40, 40);
                    g.setColor (Color.black);
                    g.drawRect (xLoc + counter, yLoc - 80, 40, 40);
                if (xCord > a - 1 && yCord == 0)
                    g.setColor (darkGray);
                    g.fillRect (xLoc + counter2, yLoc - 80, 40, 40);
                    g.setColor (Color.black);
                    g.drawRect (xLoc + counter2, yLoc - 80, 40, 40);
                counter += 40;
                counter2 += 40;
            int y = 100;
            int x = 100;
            for (int a = 0 ; a < 20 ; ++a)
                g.setColor (Color.white);
                g.fillRoundRect (x, y, 40, 40, 5, 5);
                g.setColor (Color.black);
                g.drawRoundRect (x, y, 40, 40, 5, 5);
                y += 40;
                if (a == 9)
                    x += 320;
                    y = 100;
            x = 140;
            y = 100;
            for (int a = 0 ; a < 14 ; ++a)
                g.setColor (Color.white);
                g.fillRoundRect (x, y, 40, 40, 5, 5);
                g.setColor (Color.black);
                g.drawRoundRect (x, y, 40, 40, 5, 5);
                x += 40;
                if (a == 6)
                    x = 140;
                    y += 360;
            g.setColor (Color.black);
            g.drawRect (100, 100, 360, 400);
            ImageIcon[] images = new ImageIcon [4];
            images [0] = new ImageIcon ("arrow_left.gif");
            images [1] = new ImageIcon ("arrow_up.gif");
            images [2] = new ImageIcon ("arrow_down.gif");
            images [3] = new ImageIcon ("arrow_right.gif");
            int direction = -1;
            //frame.setVisible (true);
            // direction = JOptionPane.showOptionDialog (frame, "Choose Your //\Path:", "Trapped", JOptionPane.YES_NO_CANCEL_OPTION,
            //         JOptionPane.QUESTION_MESSAGE,
            //         null,
            //         images,
            //         images [3]);
            // if (direction == 0)
            //     if (xCord - 1 > 0)
            //         xCord -= 1;
            //         xLoc += 40;
            // if (direction == 1)
            //     if (yCord - 1 > 0)
            //         yCord -= 1;
            //         yLoc += 40;
            // if (direction == 2)
            //     if (yCord + 1 < 9)
            //         yCord += 1;
            //         yLoc -= 40;
            // if (direction == 3)
            //     if (xCord + 1 < 13)
            //         xCord += 1;
            //         xLoc -= 40;
            one.addKeyListener (this);
            // one.add (button1);
            if (xCord == 1)
                LevelOne (g, one, gbc);
        /** Handle the key typed event from the text field. */
        public void keyTyped (KeyEvent e)
        /** Handle the key pressed event from the text field. */
        public void keyPressed (KeyEvent e)
            if (e.getSource () == "Up")
                JOptionPane.showMessageDialog (null, "Hi", "Hi", 0, null);
        /** Handle the key released event from the text field. */
        public void keyReleased (KeyEvent e)
            // displayInfo (e, "KEY RELEASED: ");
    }

  • Why there are two init methods?

    I copied this code from netbeans for a JApplet.. and it has two init methods
    One is public void init() that calls another initComponents() method.
    And the initComponents() method has all the components defined in it, and it is private.
    I replaced private with public and changed initComponents to init, and then deleted all the init method, it worked that way.
    But why there two methods when you can put every thing in single init() method?
    The init() method has this code in it:
    public void init() {
            try {
                java.awt.EventQueue.invokeAndWait(new Runnable() {
                    public void run() {
                        initComponents();
            } catch (Exception ex) {
                ex.printStackTrace();
        }

    BDLH:
    WWJD? Probably code in Ruby, but I digress. No, he would define an abstract base for that boilerplate code:
    import java.awt.*;
    import java.lang.reflect.*;
    import javax.swing.*;
    public abstract class AbstractApplet extends JApplet {
         public void init() {
              try {
                   EventQueue.invokeAndWait(new Runnable() {
                        public void run() {
                             initComponents();
              } catch (InterruptedException ex) {
                   ex.printStackTrace();
              } catch (InvocationTargetException ex) {
                   ex.printStackTrace();
         protected abstract void initComponents();
         //ditto: start, stop, distroy
    }

  • Is there a default focus Method ?

    I would like to have a button to be focused by default within a dialog such that user can easily fire the button's action. Is there a method to set default focus on a button ? Thanks !!!

    That's actually very helpful. I can now set a default focus button on a dialog. But then for some reason I can not set it for other dialogs initiated by this dialog. Since I have an opening dialog with a number of buttons, and those buttons will open up a new dialog. Right now I can only set the default focus to the opening dialog. The other dialogs that opens up from firing the buttons did not have the same effect as the opening dialog. Is there a way to fix it ? Thanks

  • Hey There, Wee Problem Calling Methods!

    Hey theree, i have designed auser interface that will eventually do a number of functions. The code below shows this
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import javax.swing.*;
    import java.io.File;
    * ImageViewer is the main class of the image viewer application. It builds and
    * displays the application GUI and initialises all other components.
    * To start the application, create an object of this class.
    * @author Michael Kolling and David J Barnes
    * @version 1.0
    public class Interface
        // constants:
        private static final String VERSION = "Version 1.0";
        private static JFileChooser fileChooser = new JFileChooser(System.getProperty("user.dir"));
        // fields:
        private JFrame frame;
        private ImagePanel imagePanel;
        private JLabel filenameLabel;
        private JLabel statusLabel;
        private ImageInfo currentImage;
        PresentedTable pt = new PresentedTable();
        Container contentPane;
         * Create an area for artwork and show it on screen.
        public Interface()
            currentImage = null;
            makeFrame();
        // ---- implementation of menu functions ----
         * Open function: open a file chooser to select a new image file.
        private void openFile()
            int returnVal = fileChooser.showOpenDialog(frame);
            if(returnVal != JFileChooser.APPROVE_OPTION) {
                return;  // cancelled
            File selectedFile = fileChooser.getSelectedFile();
            currentImage = ImageFileManager.loadImage(selectedFile);
            if(currentImage == null) {   // image file was not a valid image
                JOptionPane.showMessageDialog(frame,
                        "The file was not in a recognized image file format.",
                        "Image Load Error",
                        JOptionPane.ERROR_MESSAGE);
                return;
            imagePanel.setImage(currentImage);
            showFilename(selectedFile.getPath());
            showStatus("File loaded.");
            frame.pack();
         * Close function: close the current image.
        private void close()
            currentImage = null;
            imagePanel.clearImage();
            showFilename(null);
         * Quit function: quit the application.
        private void quit()
            System.exit(0);
         private void showAbout()
            JOptionPane.showMessageDialog(frame,
                        "ImageViewer\n" + VERSION,
                        "About ImageViewer",
                        JOptionPane.INFORMATION_MESSAGE);
    //View Current Table
    private void view()
    PresentedTable.createAndShowGUI();//createAndShowGUI();
    contentPane.add(PresentedTable.createAndShowGUI(), BorderLayout.CENTER);
    frame.setVisible(true);
        //supporting methods
         * Display a file name on the appropriate label.
        private void showFilename(String filename)
            if(filename == null) {
                filenameLabel.setText("There Is Nothing Displayed.");
            else {
                filenameLabel.setText("File: " + filename);
         * Display a status message in the frame's status bar.
        private void showStatus(String text)
            statusLabel.setText(text);
        // ---- swing stuff to build the frame and all its components ----
         * Create the Swing frame and its content.
        private void makeFrame()
            frame = new JFrame("Interface");
            makeMenuBar();
            contentPane = frame.getContentPane();
            // Specify the layout manager with nice spacing
            contentPane.setLayout(new BorderLayout(6, 6));
            filenameLabel = new JLabel();
            contentPane.add(filenameLabel, BorderLayout.NORTH);
            imagePanel = new ImagePanel();
            contentPane.add(imagePanel, BorderLayout.CENTER);
            statusLabel = new JLabel(VERSION);
            contentPane.add(statusLabel, BorderLayout.SOUTH);
            // building is done - arrange the components and show       
            showFilename(null);
            frame.pack();
            Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
            frame.setLocation(d.width/2 - frame.getWidth()/2, d.height/2 - frame.getHeight()/2);
            frame.setVisible(true);
            frame.setSize(600,600);
         * Create the main frame's and its menu bar.
        private void makeMenuBar()
            final int SHORTCUT_MASK =
                Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
            JMenuBar menubar = new JMenuBar();
            frame.setJMenuBar(menubar);
            JMenu menu;
            JMenuItem item;
            // create the File menu
            menu = new JMenu("File");
            menubar.add(menu);
            //Allows the user to open a range Of Artwork by featured artists within the table
            item = new JMenuItem("Open Artwork");
                item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, SHORTCUT_MASK));
                item.addActionListener(new ActionListener() {
                                   public void actionPerformed(ActionEvent e) { openFile(); }
            menu.add(item);
            //Allows the user to save the current status of the table
            item = new JMenuItem("Save As");
            item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, SHORTCUT_MASK));
            menu.add(item);
            //Allows the user to close the cuurent image displayed and eitherload
            //a new image or perform anew task
            item = new JMenuItem("Close Current Image");
                item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_W, SHORTCUT_MASK));
                item.addActionListener(new ActionListener() {
                                   public void actionPerformed(ActionEvent e) { close(); }
            menu.add(item);
            menu.addSeparator();
            //Allows the user to exit appliction
            item = new JMenuItem("Quit Application");
                item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, SHORTCUT_MASK));
                item.addActionListener(new ActionListener() {
                                   public void actionPerformed(ActionEvent e) { quit(); }
            menu.add(item);
            // create the Edit menu
            menu = new JMenu("Edit");
            menubar.add(menu);
            //Add a brand new record to the table
            item = new JMenuItem("Add A Brand New Record");
            item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, SHORTCUT_MASK));
                //item.addActionListener(new ActionListener());
                menu.add(item);
            //allows the user to amend an existing record     
            item = new JMenuItem("Amend An Existing Record");
            item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R, SHORTCUT_MASK));
                //item.addActionListener(new ActionListener());
                menu.add(item);
            //Allows the user to display the current table
            item = new JMenuItem("View The Collection");
            item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T, SHORTCUT_MASK));
            //item.addActionListener(new ActionListener(){
                    //public void actionPerformed(ActionEvent e){ view(); }
                frame.setVisible(true);
                menu.add(item);
            // put a spacer into the menubar, so the next menu appears to the right
            menubar.add(Box.createHorizontalGlue());
            // create the Help menu
            menu = new JMenu("Help");
            menubar.add(menu);
            item = new JMenuItem("This is a test");
                item.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) { showAbout(); }
            menu.add(item);
    I have also wriiten a class that will produce a table when the user creates an instance of it in main. Below:import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import java.awt.Dimension;
    import java.awt.GridLayout;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import java.lang.Object;
    public class PresentedTable extends JPanel {
    private boolean DEBUG = false;
    public PresentedTable() {
    super(new GridLayout(1,0));
    String[] columnNames = {"Name",
    "Album Title",
    "Running Time(in Minutes)",
    "# of Tracks"};
    String[][] data = {{"Jeff Buckley", "Grace",
    "Sixty minutes", "11"},
    {"Pete Yorn", "Day I Forgot",
    "Forty Five Minutes", "11"},
    {"Jack Johnson", "In Between Dreams",
    "Fifty Eight Minutes", "16"},
    {"Nine Days", "The Madding Crowd",
    "Forty Three Minutes", "14"},
    {"Nada Surf", "Let Go",
    "Sixty Two Minutes", "16"},
    {"Enter Artist Name", "Enter Album Title","Enter Running Time", "Enter Number Of tracks"},
    {"Enter Artist Name", "Enter Album Title","Enter Running Time", "Enter Number Of tracks"},
    {"Enter Artist Name", "Enter Album Title","Enter Running Time", "Enter Number Of tracks"},
    {"Enter Artist Name", "Enter Album Title","Enter Running Time", "Enter Number Of tracks"},
    {"Enter Artist Name", "Enter Album Title","Enter Running Time", "Enter Number Of tracks"},
    {"Enter Artist Name", "Enter Album Title","Enter Running Time", "Enter Number Of tracks"},
    {"Enter Artist Name", "Enter Album Title","Enter Running Time", "Enter Number Of tracks"},
    {"Enter Artist Name", "Enter Album Title","Enter Running Time", "Enter Number Of tracks"},
    {"Enter Artist Name", "Enter Album Title","Enter Running Time", "Enter Number Of tracks"},
    {"Enter Artist Name", "Enter Album Title","Enter Running Time", "Enter Number Of tracks"},
    {"Enter Artist Name", "Enter Album Title","Enter Running Time", "Enter Number Of tracks"},
    {"Enter Artist Name", "Enter Album Title","Enter Running Time", "Enter Number Of tracks"},
    {"Enter Artist Name", "Enter Album Title","Enter Running Time", "Enter Number Of tracks"},
    {"Enter Artist Name", "Enter Album Title","Enter Running Time", "Enter Number Of tracks"}
    final JTable table = new JTable(data, columnNames);
    table.setPreferredScrollableViewportSize(new Dimension(800, 100));
    if (DEBUG) {
    table.addMouseListener(new MouseAdapter() {
    public void mouseClicked(MouseEvent e) {
    printDebugData(table);
    //Create the scroll pane
    JScrollPane scrollPane = new JScrollPane(table);
    //Add the scroll pane.
    add(scrollPane);
    private void printDebugData(JTable table) {
    int numRows = table.getRowCount();
    int numCols = table.getColumnCount();
    javax.swing.table.TableModel model = table.getModel();
    System.out.println("Value of data: ");
    for (int i=0; i < numRows; i++) {
    System.out.print(" row " + i + ":");
    for (int j=0; j < numCols; j++) {
    System.out.print(" " + model.getValueAt(i, j));
    System.out.println();
    System.out.println("--------------------------");
    public static PresentedTable createAndShowGUI() {
    JFrame.setDefaultLookAndFeelDecorated(true);
    //Create window.
    JFrame frame = new JFrame("PresentedTable");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    //Create content pane.
    PresentedTable newContentPane = new PresentedTable();
    newContentPane.setOpaque(true);
    frame.setContentPane(newContentPane);
    //Displaywindow.
    frame.setVisible(true);
    frame.pack();
    return newContentPane;
    public static void main(String[] args) {
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    createAndShowGUI();
    PresentedTable pt = new PresentedTable();
    IS there any way i can display the table (not necessarily) in the image panel because this is impossible. All i want to do is display the tabel when view the collection is clicked in the interface.
    I have begun to try this but i have failed misserably, any ideas? if you look in the first batch iof code you will c i have tried this method
    //View Current Table
    private void view()
    What am i doing wrong?

    Please reformat your post so that it is readable. When you post code, please post it between [code] and [/code] tags (you can use the "code" button on the message posting screen). It makes your code much easier to read and prevents accidental markup from the forum software.
    Formatting tips

  • Is there anyone using Java Methods interface of IREP in his application

    Hello everyone,
    Are you using Java Methods interface of IREP in your application?
    Nowadays I am trying to using Java Methods in my application. But I'm puzzled how to get the interface jar files that the Java Methods would import. It seems that Oracle doesn't provide such interface jar files for all Java Methods shipped in IREP. How do you do with this?
    If you have some experience about using Java Methods in application, hope to hear your voice. Thanks in advance.

    Hi friend,
    Thanks for you update.
    I'm referring to Java Methods that can be called directly by applications not Java Service Interface. These are two different kinds of IREP interfaces. In Oracle Integration Repository User's Guide, there aren't much guidance about how to use Java Methods.
    I appreciate you can help me further.

Maybe you are looking for