JOptionPane Confusion!

Hi,
Im having a real difficult time with JOptionPanes! Im still a newbie to Swing and I just cant seem to get my head around how to make the JOptionPanes do what you want them to! I've read the tutorials and manuals but im still stuck.
Basically, I have a JButton that brings up a JOptionPane. In this, the user types in the name of a camera. This is then added to a combobox (cameralist).
cameralist.addItem((JOptionPane.showInputDialog("Enter Camera Name")));
The problem is, how do I get the JOptionPane to close without doing anything else? Where do I add the code? At the moment it still adds the user's entry when you select cancel or the x in the top right hand corner.
Thanks for any help and Im sorry if I seem abit stupid!
Rach

First, trying to write a complex statement like that on a single line is bound to get you in trouble. Split the code up into several lines to make it readable, understandable and much easier to debug.
The showInputDialog will return null if the user cancels the dialog (I suppose). You should write something like this:
String result = JOptionPane.showInputDialog("Enter Camera Name");
if( result != null && !result.equals("") )
  cameralist.addItem( result );
}

Similar Messages

  • A question about JOptionPane.showOptionDialog()?

    one problem confused me.
    import javax.swing.*;
    class Test
    public Test()
         int n;
         String title;
         Object[] message = new Object[3];
         Object[] obj = new Object[2];
         message[0] = "Name ";
         message[1] = "Age";
         title = "Information";
         obj[0] = "OK";
         obj[1] = "Cancel";
         n = JOptionPane.showOptionDialog(null,
         message,
         title,
    JOptionPane.OK_CANCEL_OPTION,
              JOptionPane.INFORMATION_MESSAGE,
                        null,
                        obj,
                        obj[0]);               
         public static void main(String[] args)
              new Test();
    i run the java compiler in command line.
    c:\proj1>javac Test.java
    c:\proj1>java Test
    Having done the program, i found that command line didnot return to "c:\proj1>"
    only after "Ctrl-c" can that return back to the "c:\proj1". i didnot meet this problem when i run other java projects.
    what's the problem?
    thanks!

    Implement a call to System.exit(0) at the point you want the programm to close.
    (Depending on the return code of your option dialog)

  • Is it possible to combine JOptionPanes

    Hi, i'm trying to write a cute program for my sister to help her with her math, no anything fancy.
    However, i was wondering weather it was possible to combine an Input JOptionPane and an Option JOption Pane, meaning it has a text area for an Input and buttons like cancel and stuff.
    Thanks in advanced for any answers.

    well, i read the link.. and got waaaayyy to confused.. moreover it did not show the example i needed. a specific example would be very welcome as i'm preety much a newbie in Java (going to the Uni only in 3 yrs) so if you could please explain it in more of a lamen terms, or give a code example, i'd be gratful. Thanks for the link tho, it was informative.

  • JOptionPane default selection

    Hi,
    I am using a JOptionPane to offer some selections to the user.
    I am trying to set the last button as the default, but it always seems to use the first button as the default.
    My code goes like this:-
    Object[] options = {"Print Applet", "Print List", "Export to File", "Cancel"};
    int selection = JOptionPane.showOptionDialog(null, "Choose Option or Cancel", "Export Options",
    JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null,
    options, options[3]);
    I want Cancel button to be default, but Print Applet is!
    Any ideas?
    Cheers
    Sue

    Works for me (see attached sample working code). You may be confusing the default button with the button that has focus. The default button is the button that responds to the Enter key press anywhere in the dialog (visually it's the button with the darker border). In your case that button is the Cancel button. However the Print Applet button has the focus (it's the button with the focus rectangle around the button's text. Pressing the spacebar will trigger an action on that button).
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    public class Option {
    public static void main(String args[]) {
      new OptionFrame();
    class OptionFrame extends JFrame implements ActionListener {
    JButton open = new JButton("Open...");
    OptionFrame() {
      super();
      /* Components should be added to the container's content pane */
      Container cp = getContentPane();
      cp.add(open);
      open.addActionListener(this);
      /* Add the window listener */
      addWindowListener(new WindowAdapter() {
       public void windowClosing(WindowEvent evt) {
        dispose(); System.exit(0);}});
      /* Size the frame */
      setSize(200,200);
      /* Center the frame */
      Dimension screenDim = Toolkit.getDefaultToolkit().getScreenSize();
      Rectangle frameDim = getBounds();
      setLocation((screenDim.width - frameDim.width) / 2,(screenDim.height - frameDim.height) / 2);
      /* Show the frame */
      setVisible(true);
    public void actionPerformed(ActionEvent evt)
      Object obj = evt.getSource();
      if (obj == open)
       Object[] options = {"Print Applet", "Print List", "Export to File", "Cancel"};
       int selection = JOptionPane.showOptionDialog(null, "Choose Option or Cancel", "Export options",
                                                                     JOptionPane.YES_NO_CANCEL_OPTION,
                                                                     JOptionPane.QUESTION_MESSAGE, null, options,
                                                                     options[3]);
    }

  • Hello:   -Easy Question I believe - JOptionPane

    Hello: **My program is below**
    I just started programming and have some basic problems. I would like my program to have a window that asks whether the amount of "people in party" is correct it would then have a text field for yes enter 1 and no enter 2. But I don't know how do get it correct. Thanks for any help. I'm getting confused with the Pane being from the main Pane add how to add different button/textfield to each.
    Tim
    I have JOptionPane open and but don't know how to add a textField and the button "ENTER" to the that JOptionPane
    **********CODE**********
    package finalproject;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Menu extends JFrame {
    private JTextField partyNumField;
    private int partyNum;
    private JButton getParty;
    private JLabel party, companyLogo;
    public Menu() {
    super("O'Brien Caterer - Where we make good Eats!");
    Container container = getContentPane();
    JPanel northPanel = new JPanel();
    northPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 80, 5));
    companyLogo = new JLabel("Welcome to O'Brien's Caterer's");
    northPanel.add(companyLogo);
    party = new JLabel("Enter the Total Number in Party Please");
    partyNumField = new JTextField(5);
    northPanel.add(party);
    northPanel.add(partyNumField);
    getParty = new JButton("GO - Continue with Order");
    getParty.addActionListener(
    new ActionListener(){
    public void actionPerformed(ActionEvent actionEvent)
    partyNum = Integer.parseInt(partyNumField.getText());
    JOptionPane.showMessageDialog(null, "Total Number is party is: " + partyNum
    + " is this correct?\n\n" + "Enter 1 to continue\n"
    + "Enter 2 to cancel\n");
    ); // end Listener
    northPanel.add(getParty);
    container.add(northPanel);
    setSize(300, 500);
    show();
    public static void main(String args[])
    Menu application = new Menu();
    application.addWindowListener(
    new WindowAdapter(){
    public void windowClosing(WindowEvent windowEvent)
    System.exit(0);

    This will do:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Menu extends JFrame
         private JTextField partyNumField;
         private int        partyNum;
         private JButton    getParty;
         private JLabel     party, companyLogo;
    public Menu()
         super("O'Brien Caterer - Where we make good Eats!");
         addWindowListener(new WindowAdapter()
        {     public void windowClosing(WindowEvent ev)
                   dispose();     
                   System.exit(0);
         Container container = getContentPane();
         JPanel northPanel   = new JPanel();
         northPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 80, 5));
         companyLogo         = new JLabel("Welcome to O'Brien's Caterer's");
         northPanel.add(companyLogo);
         party               = new JLabel("Enter the Total Number in Party Please");
         partyNumField       = new JTextField(5);
         northPanel.add(party);
         northPanel.add(partyNumField);
         getParty            = new JButton("GO - Continue with Order");
         getParty.addActionListener(new ActionListener()
              public void actionPerformed(ActionEvent actionEvent)
                   partyNum = Integer.parseInt(partyNumField.getText());
                   String a = JOptionPane.showInputDialog(null, "Total Number is party is: " + partyNum
                        + " is this correct?\n\n" + "Enter 1 to continue\n"
                        + "Enter 2 to cancel\n");
         northPanel.add(getParty);
         container.add(northPanel);
         setSize(500,300);
         show();
    public static void main(String args[])
         new Menu();
    Noah

  • I am alittle confused!

    I was wondering do you think i could be having a probelm with import java.util.Scanner because of my version?
    I am also having a problem with compiling with the import javax.JOptionPane
    my issue is tha i have coppied two programs for betum out of a book, and one i worked on with my teacher in my Intro to Algorithm class and I was having problems when i compiled.
    here is a sample of the code compiled
    import javax.swing.JOptionPane;
    public class ComputeLoan
    public static void main(String[] args)
    String annualInterestRateSring = JOptionPane.showInputDialog(
    "Enter yearly interest rate, for example 8.25");
    double monthlyInterestRate =
    Double.parseDouble(annualInterestRateString);
    double monthlyInterestRate = annualInterestRate / 1200;
    String numberOfYearsString = JOptionPane.showInputDialog(
    "Enter number of years as an integer, \nforexample 5:");
    int numberOfYears = Integer.parseInt(numberOfYearsString);
    String loanString = JOptionPane.showInputDialog(
    "Enter loan amount, for example 120000.95");
    double loanAmount = Double.parseDouble(loanString);
    double monthlyPayment = loanAmount * monthlyInterestRate/ (1
    - 1 /Math.pow(1 + monthlyInterestRate, numberOfYears * 12));
    double totalPayment = monthlyPayment * numberOfYears * 12;
    monthlyPayment = (int)(monthlyPayment * 100)/ 100.0;
    totalPayment = (int)(totalPayment * 100)/ 100.0;
    String output = "The monthly payment is" + monthlyPayment +
    "\nThe total payment is" + totalPayment;
    Joptionpane.showMessageDialog(null, output);
    he told me to check what version of Java i had so i did and i discovered that i was using vs 1.4_2-12. What i am confused about, if this is the problem, is that off dowload page i downloaded the JDK 5.0 and installed it, so why is it version 1.4 and not version 1.5?
    Any answer would be greatly appriciated.

    Because in your path you're telling your computer to look for java 1.4 before it looks for java 1.5 Edit your path and it'll work.

  • Apple ID appearing on another iPhone device (Sync confusion)

    Issue
    iTunes is sporadically requesting access to my partner's Apple ID account when downloading applications and trying to install the other iTunes account applications also when syncing takes place within iTunes. System software/accounts seems confused.
    How can I ensure that both devices remain separate and do not access each other's iTunes accounts or sync over Mac logins? How can I delete mixed applications from separate Apple ID's ensuring it won't replicate the deletion on the primary Apple ID?
    Background
    1 x Macbook Pro OS 10.8.2
    iTunes 11.0.1
    App Store 1.2.1
    1 x iPhone 4S OS 6.0.1 (Device A)
    1 x iPhone 4 OS 6.0.1 (Device B)
    Separate Apple ID's
    Separate iCloud accounts
    iTunes accounts
    Both people have our own iTunes accounts linked to their own device. All details are currently correct when checking Apple ID profiles.
    MacbookPro
    Both people have separate MacBook Pro logins and software is all up to date.
    History
    In the past, over a year ago, both iPhone devices were sync'd via the same iTunes and Macbook log in. (Not a good start I know) Both iPhones always had their own iTunes account for downloading apps and music etc. When I realised I was syncing application data from one iPhone to the other on my Macbook, I created two Macbook log ins. I deleted all applications on Device B that were transferred from Device A and also deleted the applications in Device B's iTunes account. It seemed that both devices finally had seperated, retained their own Apple ID logins, applications and Macbook user logins.
    Device B recently tried to install an application that Device A also had.
    The application installed onto Device B without an issue and there was no confusion with Device A having the same application. The application can be upgraded to provide additional functionality. When Device B requested this within the application to upgrade, the Apple ID of Device A suddenly appeared.
    I checked that Device B was asked to INSTALL the primary basic version of the application rather than OPEN it, just incase the confusion started at this point. It definitely said INSTALL.
    I thought the divorce was done and dusted in the past.
    Why would Device B suddenly point Device A's Apple ID?
    To troubleshoot, I connected Device B to iTunes on the MacBook with Device B's Macbook log in. When iTunes opened within the Apple ID of Device B ALL DEVICE A applications appeared and started to sync these applications to Device B! I am back to mixed accounts.
    How can ITunes suddenly connect the Apple ID's of both accounts and then tell Device B it needs to install Device A's applications? They are separate Apple ID accounts, separate copyright, separate costs.
    I know with iMatch that you can share the library with another device and when this occurs it locks the Apple ID of the primary iTunes account for 90 days on secondary device. We have never done this.
    I'm 'Syncing' trying to work this one out, please help!

    Steve324 wrote:
    s there a solution to get things
    back the way it was before the install?
    Thank you!
    See my previous suggestions

  • HT1414 i am in the process of getting my iphone4 unlocked from att to use it on straighttalk. why do i need to "back up" the iphone and all of this? i dont have an apple computer sooo, im a little confused on why i need to do this. can someone please help

    Can someone please explain and help me? I am unlocking an iphone4 from at&t to use it on the straight talk network. They've confirmed my request to do this and I am now a little confused as to what to do next. They want me to back up the phone using itunes on either a MAC or PC. I do not have an aplle computer but I do have an acer. Sooo, can I use it to do this? Or do I even have to do this to unlock and switch the iphone4 over to a new network? If I do have to what can I do to do this because like I said I do not have a computer by apple? Can anybody walk me through what I need to do next please? I've been waiting to do this for a very long time and I now have the option to have an iphone and use it. Thanks to my awesome boyfriend who Gave me his old iphone when he swapped back to an android. Hahahaha! Please anybody!? Because I sooo don't know what I'm doing and really do not want to mess the phone Or the process up. Thanks to any and all who read this and help me! It is greatly appreciate it!

    Install iTunes on your Acer and you can back up the iPhone. Or back it up to iCloud. If you do not back it up you can get it unlocked, but you will lose all of your content.
    You can get iTunes from http://www.apple.com/itunes.
    Even after unlocking I'm not sure it will work on Straight Talk, because last time I checked ST used Verizon as its carrier, and an AT&T iPhone 4 is not compatible with Verizon's network. You can probably use it on Net 10 or T-Mobile once it is unlocked.

  • Computers on small office network - names getting confused on iChat

    We are using bonjour and iChat on the computers on a small airport network in our office as an instant messaging solution in our office - however, 2 of the computers (which are named differently) keep getting confused and both being called the same name.
    I have done the fix where you go to System Prefs, Users & Groups and then set the address book card to that particular computer owner, restart the computer and then open iChat (using bonjour) - it saves the name but then my colleague becomes the same name as me on iChat - so we do the same thing to her computer (set address book card etc) and it changes her iChat name, but then also seems to override what I had set for mine previously.
    Help!! What can I do to stop these 2 computers seemingly overriding each other? It doesn't happen with the other 4 computers sharing our network...

    Hi,
    In System Preferences > Sharing is the Name the Computer has.
    This does play a part in any Bonjour Connection.
    It is this name that appears in Shares in the Finders's Side bar.
    Separate for that iChat and Messages that have the Bonjour Account Enabled broadcast the details from the My Card in the Address Book.
    Issues can arise with some Server based Logins that create a Global Address book that changes the My Card.
    You get similar difficulties on some DiskImage roll outs of updates and the like if the details of the Address Book are copied as well.
    I am not sure what you mean by the "fix" in System Preferences > Users and Groups to change the My Card or the Computer's Name.
    Yes you can click the Contact Card for that account and it will show you it in the Address Book and it should be th My Card.
    Changing the My Card then does not alter which Card is associated with the Mac User Account.
    There is no access to the Computer's Name
    7:53 PM      Wednesday; August 1, 2012
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Lion 10.7.2)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • Unable to capture video from canon xha1s to final cut pro 6.0. so confused

    hi,
    i purchased a canon xha1s and am simply trying to capture the video onto my macbook pro laptop. i keep getting the error saying my settings are incorrect and am confused as what to put and where. i went to the video/audio settings and put what i believed to be correct (HDV) since my camcorder records in HDV. still that error window pops up when i try to log and capture footage.
    any help would be greatly appreciated!

    Hi .. I had a very similar problem .. if the above fails it may be worth a look at this too..
    http://discussions.apple.com/message.jspa?messageID=10804559#10804559
    Jim

  • Unable to return values in joptionpane

    Hi all,
    Im having a slight problem with some code regarding a joptionpane. With the help of some code i found on the internet (lol i know theres a lot of bad stuff out there but i thought id give it a go), im making a new object array containing my fields, and then adding these objects to the joptionpane. it seems to work ok, but i cant get back the values the user entered into the fields - for a normal joptionpane id call the getText() method. (nb this is only a small test application, so it is ok that a password is being returned for anyone to see!)
    In my code below, all i can get it to do is return the objects details eg javax.swing.JTextField[,0,19,195x20,layout=javax.swing.plaf.basic.BasicTextUI$UpdateHandler,alignmentX=0.0 etc...., and not the value the user entered!
    Is this bad code for what im trying to do? what is the easiest way of returning the users password?
    Thanks in advance
    Torre
    here is the code:
    if ("changePwdPressed".equals(e.getActionCommand())){
                   Object complexMsg[] = { "Current Password: ", new JTextField(10), "New Password: ", new JTextField(10), "Confirm New Password: ", new JTextField(10) };
                   JOptionPane optionPane = new JOptionPane();
                   optionPane.setMessage(complexMsg);
                   optionPane.setMessageType(JOptionPane.INFORMATION_MESSAGE);
                  JDialog dialog = optionPane.createDialog(this, "Change Password");
                  dialog.setVisible(true);
                  int i;
                  for (i=0; i<complexMsg.length; i++)
                  System.out.println(complexMsg);

    This works, but it's ugly...
    package forums;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    class ComplexJDialogTest
      public static void main(String[] args) {
        try {
          System.out.println("Hello World!");
          message();
          System.out.println("Hello World!");
        } catch (Exception e) {
          e.printStackTrace();
      private static void message() {
        Object messages[] = {
            "Current Password: ", new JTextField(10)
          , "New Password: ", new JTextField(10)
          , "Confirm New Password: ", new JTextField(10)
        JOptionPane optionPane = new JOptionPane(messages, JOptionPane.INFORMATION_MESSAGE);
        JDialog dialog = optionPane.createDialog(null, "Change Password");
        dialog.setVisible(true);
        for (int i=1; i<messages.length; i+=2) {
          System.out.println(((JTextField)messages).getText());
    dialog.dispose();
    ... I think I would prefer swmtgoet_x's solution... just create your three JTextField's (keep references to them) pass them to the JDialog, then (after user hits OK done) just access them directly.... ergo...
    package forums;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    class ComplexJDialogTest
      public static void main(String[] args) {
        try {
          System.out.println("Hello World!");
          message();
          System.out.println("Hello World!");
        } catch (Exception e) {
          e.printStackTrace();
      private static void message() {
        JTextField oldPassword = new JTextField(10);
        JTextField newPassword = new JTextField(10);
        JTextField newPasswordAgain = new JTextField(10);
        Object messages[] = {
            "Current Password: ", oldPassword
          , "New Password: ", newPassword
          , "Confirm New Password: ", newPasswordAgain
        JOptionPane optionPane = new JOptionPane(messages, JOptionPane.INFORMATION_MESSAGE);
        JDialog dialog = optionPane.createDialog(null, "Change Password");
        dialog.setVisible(true);
        dialog.dispose();
        System.out.println(oldPassword.getText());
        System.out.println(newPassword.getText());
        System.out.println(newPasswordAgain.getText());

  • TS3276 I cannot connect to my outgoing email server on my macBook pro, yet I can, for the same email account on my iPad. Also I can send emails from the other email account I have on my MacBook...really confused can anyone help?

    I cannot connect to my outgoing email server on my macBook pro, yet I can, for the same email account on my iPad. Also I can send emails from the other email account I have on my MacBook...really confused can anyone help?

    Sometimes deleting the account and then re-creating it can solve this issue
    Write down all the information in accounts before doing this
    Highlight the account on the left and click the minus button
    Then click the plus button to add the new account and follow the prompts

  • The method add() in java.awt.Container made me in confuse

    Here is my two java code file:
    //MyContainer.java
    package sam.gui;
    import java.awt.Dimension;
    import java.awt.Graphics;
    import javax.swing.JApplet;
    import javax.swing.JFrame;
    public class MyContainer extends JApplet {
         private MyButton[] myButton = new MyButton[2];
         private static int counter = 0;
         public MyContainer() {
              myButton[0] = new MyButton(5, 5, 200, 30);
              myButton[1] = new MyButton(5, 40, 200, 30);
              for (int i = 0; i < myButton.length; i++) {
                   add(myButton);
         public void paint(Graphics g) {
              for (int i = 0; i < myButton.length; i++) {
                   System.out.println("MyButton : " + (i+1));
                   myButton[i].draw(g);
         public static void main(String[] args) {
              MyContainer container = new MyContainer();
              JFrame f = new JFrame();
              f.getContentPane().add(container);
              f.pack();
              f.setSize(new Dimension(300, 200));
              f.show();
    //MyButton.java
    package sam.gui;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    public class MyButton extends Component {
         private Color m_rectColor = new Color(128, 73, 0);
         public MyButton(int x, int y, int width, int height) {
              setBounds(x, y, width, height);     
         public void draw(Graphics g) {
              Graphics2D g2 = (Graphics2D)g;
              g.setColor(m_rectColor);
              g.fillRect(0, 0,
                        getBounds().width, getBounds().height);
              System.out.println("x = " + getBounds().x);
              System.out.println("y = " + getBounds().y);
              System.out.println("width = " + getBounds().width);
              System.out.println("height = " + getBounds().height);          
    I thinked the runned result should be below:
    MyButton : 1
    x = 5
    y = 5
    width = 200
    height = 30
    MyButton : 2
    x = 5
    y = 40
    width = 200
    height = 30But in fact, its result is here:
    MyButton : 1
    x = 5
    y = 5
    width = 200
    height = 30
    MyButton : 2
    x = 0
    y = 0
    width = 292
    height = 173I don't know why the result would like this? I have used add(...) method to add two component MyButton to the container MyContainer, But the bounds of the second component is not I want.
    So this problem made me go into confuse.

    You need to learn how layout managers work. The default layout manager of a JApplet and JFrame is BorderLayout .
    /Kaj

  • Confused about Open Cursors :(

    Hi all,
    i need some clarification on this issue, i've read throught the documentation and i'm a bit confused.
    I'm using 10.1.0.2
    select sum(value)
    from v$statname sn,
    v$sesstat st,
    v$session s
    where sn.statistic# = st.statistic#
    and st.sid = s.sid
    and sn.name = 'session cursor cache count'
    The result of the above query is 4926, meaning i have 4926 CLOSED cursors in the session cursor cache.
    select count(1)
    from v$open_cursor
    The result of the above query is 16968, meaning i have 16968 cached cursors
    So there are two distinct cursor Caches ?
    now lets look at other statistic
    select sum(value)
    from v$statname sn,
    v$sesstat st,
    v$session s
    where sn.statistic# = st.statistic#
    and st.sid = s.sid
    and sn.name = 'opened cursors current'
    this one gives me 12212 , so i have 12212 opened cursors (NOT CACHED , REALLY OPENED CURSORS ...is this correct???)
    I suspect that my applications are not closing resultsets (java build application, deployed in oracle application server, database connections in pooled connection) ... so i'm trying to help my developers to find the potencial bug in application.
    How can i get the SQL from OPEN cursors ???
    V$open_cursor gives me SQL from CLOSED cached cursors ...
    Best Regards
    Rui Madaleno

    Hi,
    >>this one gives me 12212 , so i have 12212 opened cursors (NOT CACHED , REALLY OPENED CURSORS ...is this correct???)
    For your instance, yes because you use the sum(value) aggregate function. But I think that the best is get this value per session.
    select count(1) from v$open_cursor
    v$open_cursor shows cached cursors, not currently open cursors, by session. If you're wondering how many cursors a session has open, don't look in v$open_cursor. It shows the cursors in the session cursor cache for each session, not cursors that are actually open. To monitor open cursors, query v$sesstat where name='opened cursors current'. This will give the number of currently opened cursors, by session:
    select a.value, s.username, s.sid, s.serial#
    from v$sesstat a, v$statname b, v$session s
    where a.statistic# = b.statistic#  and s.sid=a.sid
    and b.name = 'opened cursors current';
    >>I suspect that my applications are not closing resultsets (java build application, deployed in oracle application server, database connections in pooled connection)
    In this case, you need to monitor you application. If want, you can use the OEM Database Console and go to [Top Sessions | Session Details] link, or to use this SQL above.
    By the way, do you are getting ORA-1000 errors ?
    If so, set the OPEN_CURSORS parameter high enough that you never get an ORA-1000 during normal operations.
    Cheers

  • Table numbering confusion and how to link to tables in a book/document?

    More questions :-(
    Table numbering confusion...
    I'm porting over (from MS Word) a document that has a bunch of tables in it.
    The document currently looks something like this:
    1 Major heading
    1.1 Sub heading
    text for that sub heading that refers to a table that follows (or may preceed) such as see Table 1-1 that follows
    Table 1-1
    Row 1/Column 1 content   Column 2 content   Column 3 content
    Row 2/Column 1 content   etc....            etc.
    Row 3                    etc.               etc.
    1.2 Next sub heading
    Text to follow that sub head that references Table 1-2 below...
    Table 1-2
    Row 1/Column 1 content   Column 2 content   Column 3 content
    Row 2/Column 1 content   etc....            etc.
    Row 3                    etc.               etc.
    2 Major heading
    2.1 Next sub heading
    Text to follow that sub head that references Table 2-1 below...
    Table 2-1
    Row 1/Column 1 content   Column 2 content   Column 3 content
    Row 2/Column 1 content   etc....            etc.
    Row 3                    etc.               etc.
    3 Major heading
    3.1 Next sub heading
    etc.
    Hopefully that makes sense.
    Currently it seems that the tables are numbered based on the chapter number with the chapter apparently being set at 2.
    I need the tables to instead use numbering based on the heading (Titles) numbers, but can't seem to figure out how to get the numbers set for the tables as I would want them to be.
    What do I need to do to make the table numbers reset based on the paragraph numbers (subchapters if you would refer to them that way...)
    Thanks again!

    What is the paragraph format of "Table 2-1" lines?
    Table numbering is commonly controlled by two things:
    1. Format > Paragraph > Paragraph Designer
    [table title para name]
    [ Numbering]
    and
    2. Format > Document > Numbering
    The default in Frame is that tables have titles of para fmt "TableTitle", but tables can switch that off, and also be anchored to paragraphs (often Headings) of any arbitrary format name and numbering scheme.

Maybe you are looking for

  • Ipod wont copy songs from itunes as it contains more than 5 accounts

    i know you can only register 5 computers to use ipod, but i only have 1 registered, ive tried authorizing and deautorising my accounts, my friends have put songs on my ipod when the m ipod crashed for me, and i just created an account here in the u.s

  • Timer to alternately show/hide 2 objects

    Hi, I'm trying to learn how to use a Timer and AS3 to set up 2 objects (for example, 2 squares, each with a separate instance name) that would show/hide alternately for 500 ms each for 30 seconds (30000 ms) total. Easy enough to do using a timeline,

  • Subscription Confusion

    Hello Ok yesterday I was confused because a lot of ondemand shows that should be FREE were suddenly showing up as £1.10 charge to watch them and after reading a few messages and the price change information in january which reduced all packages (Bron

  • Keywords on Export

    After reading up on exporting where you can strip out EXIF data I'm still uncertain about keywords when images are Exported. Are the keywords kept when exporting? These are Stock Photos and some metadata is required. Running LR 1.3.1 on OSX 10.11. St

  • Where to select video format

    I thought I was editing in the NTSC format, however when I export my project (via compressor) and bring it into DVDSP the following message appears: Import Error one or more files failed to import. common reasons for this are that they do not match t