A New Thread With Each Mouse Click

Dear Java Programmers,
The following code gives a bouncing ball inside of a panel. With each click, I need to have a different ball added and the previous ball to keep on bouncing. This part is a larger question of multitreading. When I have an action listener for mouse clicks, and I need to have a new thread with each click, how do I do this and where do I put it?
Thank you in advance.
import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Graphics;
import java.awt.*;
import java.awt.Color;
import java.awt.event.MouseListener;
import java.awt.event.MouseEvent;
public class Multiball extends JPanel implements Runnable, MouseListener {
Thread blueBall;
boolean xUp, yUp;
int x= -10, y= -10, xDx, yDy;
public Multiball()
xUp = false;
yUp = false;
xDx = 1;
yDy = 1;
addMouseListener( this );
public void mousePressed( MouseEvent e )
x = e.getX();
y = e.getY();
blueBall = new Thread( this );
blueBall.start();
public void paint( Graphics g )
super.paint( g );
g.setColor( Color.blue );
g.fillOval( x, y, 10, 10 );
public void run()
while ( true ) {
try {
blueBall.sleep( 10 );
catch ( Exception e ) {
System.err.println( "Exception: " + e.toString() );
if ( xUp == true )
x += xDx;
else
x -= xDx;
if ( yUp == true )
y += yDy;
else
y -= yDy;
if ( y <= 0 ) {
yUp = true;
yDy = ( int ) ( Math.random() * 1 + 2 );
else if ( y >= 183 ) {
yDy = ( int ) ( Math.random() * 1 + 2 );
yUp = false;
if ( x <= 0 ) {
xUp = true;
xDx = ( int ) ( Math.random() * 1 + 2 );
else if ( x >= 220 ) {
xUp = false;
xDx = ( int ) ( Math.random() * 1 + 2 );
repaint();
public void mouseExited( MouseEvent e ) {}
public void mouseClicked( MouseEvent e ) {}
public void mouseReleased( MouseEvent e ) {}
public void mouseEntered( MouseEvent e ) {}
public static void main(String args[])
JFrame a = new JFrame("Ball Bounce");
a.add(new Multiball(), BorderLayout.CENTER);
a.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
a.setSize(240,230);
a.setVisible(true);
}

Thank you very much for your replies. As for the multithreading, I have created 20 threads in the main method. With each click, one of these 20 threads starts in order. Now, how do I get a ball to paint with each one? How do I reference them in the paintComponent method?
   public void mousePressed( MouseEvent e )
         x = e.getX();
         y = e.getY();
         blueBall = new Thread( this );
         blueBall.start();
         count ++;
         System.out.print ("count is " + count);
      MyThread[] threads = new MyThread[20];
            for ( int ball = 0;ball < count; ball ++){
            threads[ball] = new MyThread ("" + ball);
            threads[ball].start ();
   }

Similar Messages

  • Looking up the values in a waveform graph with a mouse click

    Hi,
    Does anyone know how to look up the values in a waveform graph with a mouse
    click but... without the cursor legend on, if i press in the waveform graph
    nothing happens, i must search my cursors and only then i can see the values
    of my signal data?! Isn't there any other way?
    Best regards,
    Thijs Boerée

    Dear Chad,
    I know of the function "bring cursor to center". I also figured out that
    when i use a property node of the cursor array of clusters, that i can see
    that some values change when i move the cursor (i can see the X and Y scale
    value change of the graph and also the values of the mouse pointer (in
    points due to screen resolution)) But in this cluster i can't set the mouse
    position. I allready made a VI where i can see the bounds of my
    waveformgraph and I have the Xscale (min and max) and the Yscale (min and
    max), with a linear fit i can translate my mouse position to X an Y scale
    values and when i click on my waveform graph the cursor go's to that
    position (property node of the cursor position), only disadvantage is that i
    only have the bounds of my plot area and not the position, i do have the
    position of my waveform graph but the plot area isn't allways in the center,
    if i could extract the position of the plot area i may find a solution to
    solve this problem.
    And to file a product question:
    I would like to see the function that with a mouse click a little menu
    appears and that there are options to for example set a marker on that data
    and when you right click on it, that there are options to remove it or to
    add comment, a 2D array could make a list of the different channels with
    it's markers (time stamps and comments).
    Best regards,
    And thank you for your help.
    Thijs Boer�e
    "Chad AE" schreef in bericht
    news:[email protected]...
    > Dear Thijs,
    >
    > Thank you for contacting National Instruments.
    >
    > To address your question, there is no direct VI, command, or property
    > node that will allow the cursor snap-to-mouse functionality.
    >
    > I notice a problem you may be occuring is trying to find where the
    > cursor is on the graph. If this is an issue, you can select Bring to
    > Center from the Formatting Ring on the Cursor Legend to move the
    > cursor to the center of the graph.
    >
    > Let me know if you have any further questions or if this does not
    > resolve your issue, as I would be happy to file a product suggestion
    > so that LabVIEW is improved in future versions.
    >
    > Thanks again and have a great day!
    >
    > Chad AE
    > Applications Engineer - National Instruments

  • Draw with single mouse click, help me!!!!

    I am using this code - as you understood from it- to paint with the mouse click.
    please help me either by completing it or by telling me what to do.
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class Hello extends JFrame{
         Graphics g;
         ImageIcon icon = new ImageIcon("hello.gif");
         public Hello(){
              super("Hello");
              setSize(200, 200);
              addMouseListener(
                   new MouseAdapter(){
                        public void mouseClicked(MouseEvent e){
                             icon.paintIcon(Hello.this, g, e.getX(), e.getY());
                             g.fillRect(10, 40, 10, 80);
                             JOptionPane.showMessageDialog(Hello.this, e.getX() + ", " + e.getY());
                             //repaint();
         // i have tried to place this listener in the paint method, but no way out.
              setVisible(true);
         public void paint(final Graphics g){
              this.g = g;
              icon.paintIcon(this, g, 100, 50);
         public static void main(String[] args){
              new Hello();
    **

    You can't save a graphics object like that and then paint on it.
    What you need is to use a BufferedImage, paint on that, and then paint that to the screen.
    See my paintarea class. You are welcome to use + modify this class as well as take any code snippets to fit into whatever you have but please add a comment where ever you've incorporated stuff from my class
    PaintArea.java
    ===========
    * Created on Jun 15, 2005 by @author Tom Jacobs
    package tjacobs.ui;
    import java.awt.image.BufferedImage;
    import java.awt.*;
    import java.awt.event.*;
    import java.beans.PropertyChangeEvent;
    import java.beans.PropertyChangeListener;
    import javax.swing.ImageIcon;
    import javax.swing.JComboBox;
    import javax.swing.JComponent;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JToolBar;
    import javax.swing.SwingUtilities;
    import tjacobs.MathUtils;
    * PaintArea is a component that you can draw in similar to but
    * much simpler than the windows paint program.
    public class PaintArea extends JComponent {
         BufferedImage mImg; //= new BufferedImage();
         int mBrushSize = 1;
         private boolean mSizeChanged = false;
         private Color mColor1, mColor2;
         static class PaintIcon extends ImageIcon {
              int mSize;
              public PaintIcon(Image im, int size) {
                   super(im);
                   mSize = size;
         public PaintArea() {
              super();
              setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
              addComponentListener(new CListener());
              MListener ml = new MListener();
              addMouseListener(ml);
              addMouseMotionListener(ml);
              setBackground(Color.WHITE);
              setForeground(Color.BLACK);
         public void paintComponent(Graphics g) {
              if (mSizeChanged) {
                   handleResize();
              //g.drawImage(mImg, mImg.getWidth(), mImg.getHeight(), null);
              g.drawImage(mImg, 0, 0, null);
              //super.paintComponent(g);
              //System.out.println("Image = " + mImg);
              //System.out.println("Size: " + mImg.getWidth() + "," + mImg.getHeight());
         public void setBackground(Color c) {
              super.setBackground(c);
              if (mImg != null) {
                   Graphics g = mImg.getGraphics();
                   g.setColor(c);
                   g.fillRect(0, 0, mImg.getWidth(), mImg.getHeight());
                   g.dispose();
         public void setColor1(Color c) {
              mColor1 = c;
         public void setColor2(Color c) {
              mColor2 = c;
         public Color getColor1() {
              return mColor1;
         public Color getColor2() {
              return mColor2;
         class ToolBar extends JToolBar {
              ToolBar() {
                   final ColorButton fore = new ColorButton();
                   fore.setToolTipText("Foreground Color");
                   final ColorButton back = new ColorButton();
                   back.setToolTipText("Background Color");
                   JComboBox brushSize = new JComboBox();
                   //super.createImage(1, 1).;
                   FontMetrics fm = new FontMetrics(getFont()) {};
                   int ht = fm.getHeight();
                   int useheight = fm.getHeight() % 2 == 0 ? fm.getHeight() + 1 : fm.getHeight();
                   final BufferedImage im1 = new BufferedImage(useheight, useheight, BufferedImage.TYPE_INT_RGB);
                   Graphics g = im1.getGraphics();
                   g.setColor(Color.WHITE);
                   g.fillRect(0, 0, useheight, useheight);
                   g.setColor(Color.BLACK);
                   g.fillOval(useheight / 2, useheight / 2, 1, 1);
                   g.dispose();
                   //im1.setRGB(useheight / 2 + 1, useheight / 2 + 1, 0xFFFFFF);
                   final BufferedImage im2 = new BufferedImage(useheight, useheight, BufferedImage.TYPE_INT_RGB);
                   g = im2.getGraphics();
                   g.setColor(Color.WHITE);
                   g.fillRect(0, 0, useheight, useheight);
                   g.setColor(Color.BLACK);
                   g.fillOval(useheight / 2 - 1, useheight / 2 - 1, 3, 3);
                   g.dispose();
    //               im2.setRGB(useheight / 2 - 1, useheight / 2 - 1, 3, 3, new int[] {     0, 0xFFFFFF, 0,
    //                                                            0xFFFFFF, 0xFFFFFFF, 0xFFFFFF,
    //                                                            0, 0xFFFFFF, 0}, 0, 1);
                   final BufferedImage im3 = new BufferedImage(useheight, useheight, BufferedImage.TYPE_INT_RGB);
                   g = im3.getGraphics();
                   g.setColor(Color.WHITE);
                   g.fillRect(0, 0, useheight, useheight);
                   g.setColor(Color.BLACK);
                   g.fillOval(useheight / 2 - 2, useheight / 2 - 2, 5, 5);
                   g.dispose();
    //               im3.setRGB(useheight / 2 - 2, useheight / 2 - 2, 5, 5, new int[] {     0, 0, 0xFFFFFF, 0, 0, 
    //                                                            0, 0xFFFFFF, 0xFFFFFFF, 0xFFFFFF, 0,
    //                                                            0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF,
    //                                                            0, 0xFFFFFF, 0xFFFFFFF, 0xFFFFFF, 0,
    //                                                            0, 0, 0xFFFFFF, 0, 0}, 0, 1);
                   //JLabel l1 = new JLabel("1 pt", new ImageIcon(im1), JLabel.LEFT);
                   //JLabel l2 = new JLabel("3 pt", new ImageIcon(im2), JLabel.LEFT);
                   //JLabel l3 = new JLabel("5 pt", new ImageIcon(im3), JLabel.LEFT);
                   brushSize.addItem(new PaintIcon(im1, 1));
                   brushSize.addItem(new PaintIcon(im2, 3));
                   brushSize.addItem(new PaintIcon(im3, 5));
                   //brushSize.addItem("Other");
                   add(fore);
                   add(back);
                   add(brushSize);
                   PropertyChangeListener pl = new PropertyChangeListener() {
                        public void propertyChange(PropertyChangeEvent ev) {
                             Object src = ev.getSource();
                             if (src != fore && src != back) {
                                  return;
                             Color c = (Color) ev.getNewValue();
                             if (ev.getSource() == fore) {
                                  mColor1 = c;
                             else {
                                  mColor2 = c;
                   fore.addPropertyChangeListener("Color", pl);
                   back.addPropertyChangeListener("Color", pl);
                   fore.changeColor(Color.BLACK);
                   back.changeColor(Color.WHITE);
                   brushSize.addItemListener(new ItemListener() {
                        public void itemStateChanged(ItemEvent ev) {
                             System.out.println("ItemEvent");
                             if (ev.getID() == ItemEvent.DESELECTED) {
                                  return;
                             System.out.println("Selected");
                             Object o = ev.getItem();
                             mBrushSize = ((PaintIcon) o).mSize;
                   //Graphics g = im1.getGraphics();
                   //g.fillOval(0, 0, 1, 1);
                   //BufferedImage im1 = new BufferedImage();
                   //BufferedImage im1 = new BufferedImage();
         protected class MListener extends MouseAdapter implements MouseMotionListener {
              Point mLastPoint;
              public void mouseDragged(MouseEvent me) {
                   Graphics g = mImg.getGraphics();
                   if ((me.getModifiers() & InputEvent.BUTTON1_MASK) != 0) {
                        g.setColor(mColor1);
                   } else {
                        g.setColor(mColor2);
                   Point p = me.getPoint();
                   if (mLastPoint == null) {
                        g.fillOval(p.x - mBrushSize / 2, p.y - mBrushSize / 2, mBrushSize, mBrushSize);
                        //g.drawLine(p.x, p.y, p.x, p.y);
                   else {
                        g.drawLine(mLastPoint.x, mLastPoint.y, p.x, p.y);
                        //g.fillOval(p.x - mBrushSize / 2, p.y - mBrushSize / 2, mBrushSize, mBrushSize);
                        double angle = MathUtils.angle(mLastPoint, p);
                        if (angle < 0) {
                             angle += 2 * Math.PI;
                        double distance = MathUtils.distance(mLastPoint, p) * 1.5;
                        if (angle < Math.PI / 4 || angle > 7 * Math.PI / 4 || Math.abs(Math.PI - angle) < Math.PI / 4) {
                             for (int i = 0; i < mBrushSize / 2; i ++) {
                                  g.drawLine(mLastPoint.x, mLastPoint.y + i, p.x, p.y + i);
                                  g.drawLine(mLastPoint.x, mLastPoint.y - i, p.x, p.y - i);
    //                              System.out.println("y");
    //                              System.out.println("angle = " + angle / Math.PI * 180);
                        else {
                             for (int i = 0; i < mBrushSize / 2; i ++) {
                                  g.drawLine(mLastPoint.x + i, mLastPoint.y, p.x + i, p.y);
                                  g.drawLine(mLastPoint.x  - i, mLastPoint.y, p.x - i, p.y);
    //                              System.out.println("x");
    //                    System.out.println("new = " + PaintUtils.printPoint(p));
    //                    System.out.println("last = " + PaintUtils.printPoint(mLastPoint));
                        //System.out.println("distance = " + distance);
                        //Graphics2D g2 = (Graphics2D) g;
                        //g2.translate(mLastPoint.x + mBrushSize / 2, mLastPoint.y);
                        //g2.rotate(angle);
                        //g2.fillRect(0, 0, (int) Math.ceil(distance), mBrushSize);
                        //g2.rotate(-angle);
                        //g2.translate(-mLastPoint.x + mBrushSize / 2, -mLastPoint.y);
    //                    g.setColor(Color.RED);
    //                    g.drawRect(p.x, p.y, 1, 1);
                   mLastPoint = p;
                   g.dispose();
                   repaint();
              public void mouseMoved(MouseEvent me) {}
              public void mouseReleased(MouseEvent me) {
                   mLastPoint = null;
         private void handleResize() {
              Dimension size = getSize();
              mSizeChanged = false;
              if (mImg == null) {
                   mImg = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_RGB);
                   Graphics g = mImg.getGraphics();
                   g.setColor(getBackground());
                   g.fillRect(0, 0, mImg.getWidth(), mImg.getHeight());
                   g.dispose();
              else {
                   int newWidth = Math.max(mImg.getWidth(),getWidth());
                   int newHeight = Math.max(mImg.getHeight(),getHeight());
                   if (newHeight == mImg.getHeight() && newWidth == mImg.getWidth()) {
                        return;
                   BufferedImage bi2 = new BufferedImage(newWidth, newHeight, BufferedImage.TYPE_INT_RGB);
                   Graphics g = bi2.getGraphics();
                   g.setColor(getBackground());
                   g.fillRect(0, 0, bi2.getWidth(), bi2.getHeight());
                   g.drawImage(mImg, mImg.getWidth(), mImg.getHeight(), null);
                   g.dispose();
                   mImg = bi2;
         public JToolBar getToolBar() {
              if (mToolBar == null) {
                   mToolBar = new ToolBar();
              return mToolBar;
         private ToolBar mToolBar;
         public static void main (String args[]) {
              PaintArea pa = new PaintArea();
              JPanel parent = new JPanel();
              parent.setLayout(new BorderLayout());
              parent.add(pa, BorderLayout.CENTER);
              pa.setPreferredSize(new Dimension(150, 150));
              parent.add(pa.getToolBar(), BorderLayout.NORTH);
              WindowUtilities.visualize(parent);
         protected class CListener extends ComponentAdapter {
              public void componentResized(ComponentEvent ce) {
                   mSizeChanged = true;
    }

  • Why can't I open links in a new tab with a right click anymore? And why has the toolbar removed the refresh button?

    Several basic functions seem to be have vanished from Firefox. I can no longer open links in new tabs with a right click, and the refresh browser button (and back/forward navigation buttons, etc) do not appear in with consistency anymore. How do I get these basic navigational tools back? (most recent updates are installed)
    == This happened ==
    Not sure how often
    == 7 July 2010

    * Make sure that you have the "Navigation Toolbar" and the "Bookmarks Toolbar" visible: "View > Toolbars"
    * If items are missing then see if you can find them in the "View > Toolbars > Customize" window
    * If you see the item in the Customize window then drag it back from the Customize window to one of the toolbars.
    * If, in "View > Toolbars > Customize", you do not see that item then click the "Restore Default Set" button
    See also [[Back and forward or other toolbar buttons are missing]] and [[Navigation Toolbar items]]
    See http://kb.mozillazine.org/Toolbar_customization

  • Is there a way to access Bookmarks with 1 mouse click?

    Running XP, Firefox 4.0.1. I used to be able to open my bookmarks with one mouse click. Now I click on the icon, move the mouse down to "from internet explorer", then to the folder, and finally to the site shortcut. Is there a way to eliminate the extra steps?
    Thanks,
    Joe

    You can open the Bookmarks in the sidebar via View > Sidebar > Bookmarks (Ctrl+B)
    You can find toolbar buttons to open the bookmarks (star) and the history (clock) in the sidebar in the toolbar palette and drag them on a toolbar.<br />
    Firefox 4 has two bookmark buttons with a star in the Customize window.<br />
    One star button has a drop marker that open a Bookmark menu.<br />
    The other star button without the drop marker opens the bookmarks in the sidebar.<br />
    Open the Customize window via "View > Toolbars > Customize" or via "Firefox > Options > Toolbar Layout"<br />
    Press F10 or tap the Alt key to bring up the "Menu Bar" temporarily.
    * http://kb.mozillazine.org/Toolbar_customization

  • Group messaging creating a new thread with no one listed in the To: field

    Recently I have had issues with group text where I send a message to an exiting group text thread in the messaging app, and when someone responds from that thread Messages creates a new thread with no apparent sender or anyone listed in the To: field of that message.  Has anyone had or scene this issue?  So far the only solution I have found is to delete both the new thread and the old thread and start the group over again, losing all the group text history from the original thread.   

    Texts are a carrier function
    Are all your group members on iMessage?

  • Jdbc driver creates new thread for each statement with a query timeout set

    I am profiling a web application that is using the Microsoft JDBC driver, version 1.1 to connect to a sql server 2005 database. Each java.sql.Statement that is created, within the application, gets a query timeout value set on it ( statement.setQueryTimeout(...) ).
    I have discovered that the JDBC driver creates a new thread to monitor each Statement and the query timeout value. When the application is under load these threads are getting created faster then they are being destroyed and I am concerned that this will cause a performance problem in production.
    One option I have is to remove the query timeout value and the monitor threads will not be created, another is to change JDBC drivers.
    I'm curious is there any way to control this behavior so that these threads are not created or are managed more efficiently.  Is there a workaround that anyone is aware of?   Is this considered a bug?
    I have found a similar bug here for the 2000 driver:
    http://support.microsoft.com/default.aspx/kb/894552
    Cheers

    Hi,
    Thank you for using the Microsoft SQL Server JDBC driver.  You are correct that a new thread is started to monitor the query timeout when a statement is executed.  This is a potential performance issue that we may look at addressing in the upcoming v1.2 release.  The current behavior is not configurable.  The only workaround with the v1.1 driver is to limit your use of query timeouts to only those statements which you reasonably might expect to actually time out.
    We do take customer feedback very seriously, so if anyone else is concerned about this particular issue, please chime in and we will be able to give it appropriate weight.
    --David Olix [MSFT]

  • Can't open new tabs with double left click on tab bar in FF29.0.1?

    I've always enjoyed how tabs work in FF, mainly with them being on the bottom (which I had to find a work-around for by making the userChrome.css file - the "about:config" modification no longer works) and also being able to double left click on the tab bar to create new tabs.
    With the most recent update, double left clicking on the tab bar no longer has a function, and to create new tabs, I must now middle click. It's not a big deal really, but is there a way to change this back?
    I searched through some options on the "about:config" page, searched "tab" and found an option there: "browser.tabs.opentabfor.middleclick" that seemed promising. I changed the value to "False" but it didn't change anything - in fact, middle clicking still creates new tabs.
    I tried adding a modified function with "leftclick" in it, just to see if it might do anything but, nothing.
    Any other suggestions for restoring the double left click function to create new tabs? Thanks!

    ''Hydrilus wrote:''
    browser.tabs.opentabfor.middleclick
    If set to false, middle-clicking <u>links on web pages</u> opens them in a new window. It probably also affects bookmarks, history entries, and items in the address bar drop-down menu.
    ''Hydrilus wrote:''
    Any other suggestions for restoring the double left click function to create new tabs?
    You need an add-on. Here are two I know about:
    * [https://addons.mozilla.org/firefox/addon/classicthemerestorer/ Classic Theme Restorer]. In the add-on's option window, click the Special tab and check "Tabs toolbar: double click opens a new tab"
    * [https://addons.mozilla.org/firefox/addon/tab-mix-plus/ Tab Mix Plus]. In the add-on's option window, click the Mouse icon, then the Mouse Clicking tab, then the Double-click tab below that. [http://tmp.garyr.net/support/viewpage.php?t=3&p=mouse-clicking The Tab Mix Plus help page] has more details.

  • Problems with mighty mouse clicking

    Hi everybody, happy New Year first of all!
    Then my problem: I bought an Intel iMac about 1 year ago, and have been using the supplied wired mighty mouse since then. I set it up with left+right top buttons.
    I didn't have a single problem until a few weeks ago.
    First, the "typycal dirty scrolling ball" which seems to be solved by rubbing the ball on a piece of papere with the mouse up side down.
    Second, and most annoying, *the click functions seems to perform worse than before*. I mean, it looks like *I need more pressure now to have the mouse click* (either left or right) on links, icons, etc.
    Result: about half of the times, clicking the mouse (using the pressure I was used to) has no effort, I need to re-click with more intensity.
    Did anybody of you experience the same problem? I cannot understand if it is kind of software problem (say, something that can be solved by some restore function) or a physical one (dirt? But the mighty mouse cannot be unassembled...).
    TIA to all,
    Giopad65

    Hello and Welcome to Apple Discussions ...
    Fist, here are the instructions to clean a Might Mouse: http://support.apple.com/kb/HT1537
    and here: http://www.macosxhints.com/article.php?story=20060210115417864&lsrc=osxh
    Second, go to System Preferences/Keyboard&Mouse/Mouse and make sure your Tracking/Scrolling and Double Clicking is set to your liking. (The System Preferences panel is located in your Applications folder)
    Carolyn
    Message was edited by: Carolyn Samit

  • How to stop new record creation when mouse click

    Hi,
    I am working with Oracle Forms 6i.
    I have a multi record block. I have provided a 'New' button that the user should click when a new record creation is required. This is because there is some other function that needs to be performed when the new record is created. Specifically, on clicking the new button, the program populates the field with values read from another table. This works fine.
    However, I realized, that if the user clicks on the mutli-record block just below the last record, a new record gets created. This action does not cause the logic behind the 'New' button to execute and the record is created in a manner that is not acceptable.
    First question is why does the new record get created only by clicking with the mouse with the pointer below the last record? Is there a way to stop this from happening?
    Thanks in advance for your help.
    Shailesh

    Hi Andreas,
    Probably I was not able to explaing my problem.
    I have a button that creates a new record when clicked. The button's trigger has the CREATE_RECORD statement.
    When a new record is created, I need to copy values from the record above it. I have therefore used DUPLICATE_RECORD in my block's WHEN-NEW-RECORD-INSTANCE trigger.
    I cannot use DUPLICATE-RECORD in WHEN-CREATE-RECORD trigger.
    So, I am not clear about what you are suggesting.
    My problem is that a new record gets created when click with my mouse pointer below the last record in the multi-record block. Why does that happen and how to prevent it?
    Thanks
    Shailesh

  • OCI bowser generates new session with each page load

    Here is a summary of my problem:
    I am trying to implement the SAP Open Catalog Interface (OCI) with our eCommerce software, but I am having issues with the Web browser that OCI uses.
    Our eCommerce software utilizes the browser session id to identify the user. Our issues is that the OCI browser supplies a new session id with each page load.
    The weird part is that if I open a standard instance of IE, access the site, and then access the site though OCI the same session is shared by both the OCI browser and the IE browser. The OCI browser is now able to maintain the session ID as the user browses the site.
    Thanks.

    Thank you for your quick response.
    I understand that session IDs are always unique, and should only last for as long as the instance of the browser is open.
    What I have seen happen is that the session ID will get recreated with each page load with in a single instance of the OCI browser.
    When the site is opened in OCI it logs the user in, and then redirects them to the homepage. The problem is that the load of the login page, and the load of the homepage have different session IDs. If the user then clicks on a link on the homepage that page load will again have a different page load. This causes the eCommerce system to see them as separate users.
    As I described when I open an instance of IE first it seems to work. This leads me to believe that the OCI browser can read the cookie information, but can't write or create. 
    I am trying to figure out why the OCI browser keeps generating new Session IDs.

  • New Problem with my mouse

    I use an eMac running Tiger. After upgrading to the newest version of Tiger, I have an intermittent problem with my mouse. It will suddenly only 'control (right) click'. This happens whether I use an apple single button mouse or a Logitech two button mouse. The only way to regain my 'left click' capability is to restart the computer.
    Is there a driver that I need to install with this new update? I've never had this problem before.
    Thanks!

    In other words:
    Since upgrading my G4 eMac to the latest iteration of Tigger, I have been having a problem with mice. Don't matter if it is the Apple one-button mouse or a Logitech two-button mouse.
    What happens is that I lose my 'left click' capability. That is to say, my mouse will only 'control click'. When having this intermittent problem, if I have the Logitech mouse installed, the left button acts as a 'right click' button. If I have the singlt-button mouse installed, it will only 'control (right) click'. Thus, it becomes hard to properly use the 'puter.
    I have to cuss a bit and then restart the 'puter for things to be temporarily put back on track. So far, nobody knows the answer to the problem. Any Mac geniuses out there?
    Thanks!

  • Having problem with right mouse click

    When connected to a database and try to create a table using the right mouse click, only options available are a (grayed out) clear filter and help. Those options are the same when using the right mouse click on other objects. This is a clean install with the newest version available on windows XP service pack 1.

    No luck in reproducing this on SQL Developer v1.0.0.14.67, Win XP SP 2, DB 9.2.0.5.
    If my connected user has privs to create tables, I get Create Table, Apply Filter, Refresh, Clear Filter (disabled unless I have a filter) and Help.
    If my connected user doesn't have privs to create tables, I get Create Table (disabled), Apply Filter, Refresh, Clear Filter (disabled unless I have a filter) and Help.
    Even looking at the tables node under a user in the Other Users area I get Apply Filter, Refresh, Clear Filter (disabled unless I have a filter) and Help.

  • Strange issue with left mouse clicking freezing other inputs on the Mac

    I'm having a strange issue with my game. I'm using Flash CS6 and a Mac.
    I've got a character that I move around the screen with keys, and you can click the left mouse button to make him throw something. The weird issue is when I click the left mouse button a lot, it seems to stop any other inputs from coming in, so for example, if I hold the right arrow key down while I'm doing a left clicking, and then let go of the right arrow key, the character will keep on moving right for a few seconds, until it finally get's the key_up event and stops.
    Even not using any mouse event handlers, so the mouse is doing nothing in the game still causes the key inputs to be delayed just by left clicking, any ideas?
    I've just tested the .swf on a PC and there was no problem, the mouse clicking was not causing any issues, so it's something peculiar to the Mac.

    Hi,
    This could be an issue if you were using Safari 5.1+ in 64bit mode. This should go away if you run Safari 5.1+ in 32 bit mode. You can change this by
    1. Go to /Applications
    2. Find Safari->RightClick->Get Info->Check 'Open in 32-bit mode' check box.
    3. Relaunch Safari 5.1 again.
    Thanks!
    Mohan

  • Record Audio in Captivate 4 for PP Slide with multiple mouse click animation

    I have a power point presentation imported into  Captivate 4.  Several of the slides have custom animation that ocurr's on mouse click. What is the best way to record the audio for these slides and have the audio sync to the right portion of the slide?

    I am afraid there is no direct way to solve your problem. You can identify the time at which the movie stops because of an on-click animation. At every location, insert a transparent caption (blank caption) and add audio to the caption.
    Thus once the movie pauses for the user to click, audio wont appear till user click on the swf. Once he does, movie timeline will move ahead and transparent caption will appear thus playing the audio file.
    Hope this helps. Do let us know if it works.
    Regards,
    Mukul

Maybe you are looking for