How to get  the mouse clicked positions on a movie

I am doing a project on Objects tracking
I am capturing the video data using webcamera and playing it using processor in JMF
my problem is , if i click on the movie that is being played currently, i have to display the co-ordinates of the mouse clicked position.
can anyone help me?
Thanks in advance
Sudha

hello
i have attache my coding here
see to it
import java.io.*;
import java.io.IOException;
import java.net.*;
import java.net.URL;
import java.awt.*;
import java.awt.image.*;
import java.awt.event.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;
import javax.swing.*;
import javax.media.*;
import javax.media.util.*;
import javax.media.Buffer.*;
import javax.media.format.*;
import javax.media.Format;
import javax.media.protocol.*;
import javax.media.control.*;
import javax.media.rtp.*;
import javax.media.protocol.DataSource;
import com.sun.media.ui.*;
import javax.media.format.YUVFormat;
import java.util.*;
import java.util.Vector;
import javax.imageio.*;
import javax.imageio.stream.*;
class capturing1 extends JInternalFrame implements ActionListener,MouseListener,MouseMotionListener,ControllerListener
* The entry point of the example
* @param args The command line arguments
     int mark_flg=0;
     int xpos=0,ypos=0;
     mdetect mde=new mdetect();
     protected boolean transitionOK;
     protected Object synchronizer;
     protected Processor processor;
     JButton mark;
     JButton track;
capturing1(String fname)
{     super(fname, true, true, true, true);
     getContentPane().setLayout( new BorderLayout() );
     setSize(320, 10);
     setLocation(50, 50);
     setVisible(true);
     processor = null;
synchronizer = new Object();
transitionOK = true;
     mark=new JButton("mark");
     track=new JButton("track");
     mark.setSize(25,25);
     track.setSize(25,25);
     mark.addActionListener(this);
     track.addActionListener(this);
     getContentPane().add("East", mark);
     //getContentPane().add("West", track);
     try {
     UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
     } catch (Exception e) {
     System.err.println("Could not initialize java.awt Metal lnf");
     Manager.setHint(Manager.LIGHTWEIGHT_RENDERER, new Boolean(true));
     addMouseListener(this);
     addMouseMotionListener(this);
     loadAndStart(fname);
public void loadAndStart(String fn)
boolean status;
status = loadFile(fn);
if (status) status = configure();
     TrackControl tc[] = processor.getTrackControls();
     if (tc == null) {
               System.err.println("Failed to obtain track controls from the processor.");
               System.exit(0);
          // Search for the track control for the video track.
          TrackControl videoTrack = null;
          for (int i = 0; i < tc.length; i++) {
               if (tc.getFormat() instanceof VideoFormat) {
               videoTrack = tc[i];
               break;
          if (videoTrack == null) {
               System.err.println("The input media does not contain a video track.");
               System.exit(0);
     try {
     Codec codec[] = {mde};
     videoTrack.setCodecChain(codec);
     } catch (UnsupportedPlugInException e) {
     System.err.println("The processor does not support effects.");
if (status) status = realize();
public boolean loadFile(String fn)
boolean status;
URL url;
     status = false;
     /*Vector v = CaptureDeviceManager.getDeviceList(new VideoFormat(
VideoFormat.YUV));
System.out.println(((CaptureDeviceInfo) v.get(0)).getName());
try{
     MediaLocator ml = ((CaptureDeviceInfo) v.get(0)).getLocator();
System.out.println(ml.toString());
     processor = Manager.createProcessor(ml);processor.addControllerListener(this);status = true;
}catch(Exception e){
System.err.println("Exception occured\n");
e.printStackTrace();
     System.exit(0);
try {
url = new URL("file:"+
System.getProperty("user.dir")+
"/"+fn);
if (url != null) {
processor = Manager.createProcessor(url);
     processor.addControllerListener(this);
status = true;
} catch (NoProcessorException npe) {
System.out.println("Unable to create a processor!");
} catch (IOException ioe) {
System.out.println("Unable to connect to source!");
return status;
public boolean configure()
boolean status;
status = false;
// Put the Processor into the configured state
processor.configure();
if (waitFor(processor.Configured)) {               
// Set the content descriptor to null so that the
// processor can be used as a player
processor.setContentDescriptor(null);
status = true;
} else {
System.out.println("Unable to configure the processor!");
return status;
public boolean realize()
boolean status;
Component c;
status = false;
// Put the Processor into the realized state
processor.prefetch();
if (waitFor(processor.Prefetched)) {               
// The Processor has been realized so the
// components can be layed out
c = processor.getVisualComponent();
getContentPane().add("Center", c);
c = processor.getControlPanelComponent();
if (c != null)
          getContentPane().add("South", c);
System.out.println("button added");
// Start the Processor
          validate();System.out.println("button added");
processor.start();
status = true;
} else {
System.out.println("Unable to realize the processor!");
return status;
protected boolean waitFor(int state)
// Make this block synchronized
synchronized(synchronizer) {
try {
while ((processor.getState() != state) &&
(transitionOK)) {
synchronizer.wait();
} catch (InterruptedException ie) {
// Ignore it
return transitionOK;
public synchronized void controllerUpdate(ControllerEvent evt)
if ( (evt instanceof ConfigureCompleteEvent) ||
(evt instanceof RealizeCompleteEvent) ||
(evt instanceof PrefetchCompleteEvent) ) {
// Synchronize this block
synchronized(synchronizer) {
transitionOK = true;
synchronizer.notifyAll();
} else if (evt instanceof ResourceUnavailableEvent) {
// Synchronize this block
synchronized(synchronizer) {
transitionOK = false;
synchronizer.notifyAll();
public void mouseMoved(MouseEvent e) {
//saySomething("Mouse moved", e);
public void mouseDragged(MouseEvent e) {
saySomething("Mouse dragged", e);
public void mousePressed(MouseEvent e) {
//saySomething("Mouse pressed; # of clicks: "
// + e.getClickCount(), e);
public void mouseReleased(MouseEvent e) {
//saySomething("Mouse released; # of clicks: "
// + e.getClickCount(), e);
public void mouseEntered(MouseEvent e) {
//saySomething("Mouse entered", e);
public void mouseExited(MouseEvent e) {
//saySomething("Mouse exited", e);
public void mouseClicked(MouseEvent e) {
saySomething("Mouse clicked (# of clicks: "
+ e.getClickCount() + ")", e);
     xpos=e.getX(); ypos=e.getY();
void saySomething(String eventDescription, MouseEvent e) {
     System.out.println("The Object is at the point "+"x ,"+e.getX()+ "y" + e.getY());
     if(mark_flg==1){
     mdetect.markObject(xpos,ypos);
     //mark_flg=0;
public void actionPerformed(ActionEvent e)
     if(e.getSource()==track)
          System.out.println("track pressed");
          processor.start();
     if(e.getSource()==mark)
          mark_flg=1;//processor.stop();
          System.out.println("mark pressed");
public class track extends Frame
{     JDesktopPane desktop;
public track(String f)
     setLayout( new BorderLayout() );
     desktop = new JDesktopPane();
     desktop.setDoubleBuffered(true);
     add("Center", desktop);
     setSize(640, 480);
     capturing1 cap1=new capturing1(f);
     desktop.add(cap1);
     setVisible(true);
public static void main(String args[])
new track(args[0]);
/****************************** mdetect class**********************************************/
class mdetect implements Effect
     //Processor processor;
static boolean marked=true; static int mark_flg=0; int a=1;
static int xpos=0,ypos=0;
private Format inputFormat;
private Format outputFormat;
private Format[] inputFormats;
private Format[] outputFormats;
private int[] bwPixels;
private byte[] bwData;
private RGBFormat vfIn = null;
private static int imageWidth = 0;
private int imageHeight = 0;
private int imageArea = 0;
static int[] p1;
mdetect()
System.out.println("mdetect called");
inputFormats = new Format[] {
new RGBFormat(null,
Format.NOT_SPECIFIED,
Format.byteArray,
Format.NOT_SPECIFIED,
                              24,
3, 2, 1,
3, Format.NOT_SPECIFIED,
Format.TRUE,
Format.NOT_SPECIFIED)
outputFormats = new Format[] {
new RGBFormat(null,
Format.NOT_SPECIFIED,
Format.byteArray,
Format.NOT_SPECIFIED,
                              24,
3, 2, 1,
3, Format.NOT_SPECIFIED,
Format.TRUE,
Format.NOT_SPECIFIED)
     public Format[] getSupportedInputFormats() {
return inputFormats;
     public Format [] getSupportedOutputFormats(Format input) {
if (input == null) {
return outputFormats;
if (matches(input, inputFormats) != null) {
return new Format[] { outputFormats[0].intersects(input) };
} else {
return new Format[0];
     public Format setInputFormat(Format input) {
inputFormat = input;
     return input;
     public Format setOutputFormat(Format output) {
if (output == null || matches(output, outputFormats) == null)
return null;
RGBFormat incoming = (RGBFormat) output;
Dimension size = incoming.getSize();
int maxDataLength = incoming.getMaxDataLength();
int lineStride = incoming.getLineStride();
float frameRate = incoming.getFrameRate();
int flipped = incoming.getFlipped();
int endian = incoming.getEndian();
if (size == null)
return null;
if (maxDataLength < size.width * size.height * 3)
maxDataLength = size.width * size.height * 3;
if (lineStride < size.width * 3)
lineStride = size.width * 3;
if (flipped != Format.FALSE)
flipped = Format.FALSE;
outputFormat = outputFormats[0].intersects(new RGBFormat(size,
maxDataLength,
null,
frameRate,
Format.NOT_SPECIFIED,
Format.NOT_SPECIFIED,
Format.NOT_SPECIFIED,
Format.NOT_SPECIFIED,
Format.NOT_SPECIFIED,
lineStride,
Format.NOT_SPECIFIED,
Format.NOT_SPECIFIED));
return outputFormat;
public synchronized int process(Buffer inBuffer, Buffer outBuffer) {
     int i=0;
     a++;
          //System.out.println("discard buffer"+inBuffer.isEOM());
          //System.out.println("w n h");
          //System.out.println("w"+size.width+"h"+size.height);
          //System.out.println("format"+inBuffer.getFormat());
          //System.out.println("RGB"+outImage.getRGB(3,3));
          //Graphics og = outImage.getGraphics();
          //og.drawImage(stopImage, 0, 0, size.width, size.height, null);
          vfIn = (RGBFormat) inBuffer.getFormat();
     Dimension size = vfIn.getSize();
          if(inBuffer.isEOM()==false)
          BufferToImage stopBuffer = new BufferToImage((VideoFormat) inBuffer.getFormat());
          Image stopImage = stopBuffer.createImage( inBuffer);
          BufferedImage outImage = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_RGB);
          if(a==6)
          PictureButton.but(stopImage);
          System.out.println("stop image called");
          //cut
/*if(a<0)
     for(int rr=0;rr<MAXROWS;rr++)
          for(int cc=0;cc<MAXCOLS;cc++)
               System.out.print(PixelArray[rr][cc]+" ");
     System.out.println("@");
a=0;
     int outputDataLength = ((VideoFormat)outputFormat).getMaxDataLength();
validateByteArraySize(outBuffer, outputDataLength);
outBuffer.setLength(outputDataLength);
outBuffer.setFormat(outputFormat);
outBuffer.setFlags(inBuffer.getFlags());
     byte [] inData = (byte[]) inBuffer.getData();
byte [] outData =(byte[]) outBuffer.getData();
     Object data = inBuffer.getData();
int pixStrideIn = vfIn.getPixelStride();
int lineStrideIn = vfIn.getLineStride();
     imageWidth = (vfIn.getLineStride())/3; //Divide by 3 since each pixel has 3 colours.
     imageHeight = ((vfIn.getMaxDataLength())/3)/imageWidth;
     imageArea = imageWidth*imageHeight;
int r=0,g=0,b = 0; //Red, green and blue values.
     System.arraycopy(inData,0,outData,0,outData.length);
     bwPixels = new int[outputDataLength/3] ;
     p1=new int[outputDataLength/3];int[] p=new int[outputDataLength/3];
     for (int ip = 0; ip < inData.length; ip+=3) {
          int bw = 0;
               r = (int) inData[ip] ;
               g = (int) inData[ip+1] ;
               b = (int) inData[ip+2];
bw = (int) ((r + b + g)/ (double) 3);
          p1[ip/3]=bw;
     return BUFFER_PROCESSED_OK;
     public String getName() {
return "Motion Detection Codec";
public void open() {
public void close() {
public void reset() {
     public Format matches(Format in, Format outs[]) {
     for (int i = 0; i < outs.length; i++) {
     if (in.matches(outs[i]))
          return outs[i];
     return null;
public Object getControl(String controlType) {
System.out.println(controlType);
     return null;
public Object[] getControls() {
return null;
byte[] validateByteArraySize(Buffer buffer,int newSize) {
Object objectArray=buffer.getData();
byte[] typedArray;
if (objectArray instanceof byte[]) {     // Has correct type and is not null
typedArray=(byte[])objectArray;
if (typedArray.length >= newSize ) { // Has sufficient capacity
return typedArray;
byte[] tempArray=new byte[newSize]; // Reallocate array
System.arraycopy(typedArray,0,tempArray,0,typedArray.length);
typedArray = tempArray;
} else {
typedArray = new byte[newSize];
buffer.setData(typedArray);
return typedArray;
public static void markObject(int x,int y)
marked=true;
xpos=x; ypos=y;
/* int j =0, m=0,n=0;
int total = p1.length; int col = imageWidth; //int row = imageHeight;
int[][] twodim = new int[total/col][col];
System.out.println("p1 arr"+p1.length+","+twodim.length+"col"+col);
for(j=0;j<total;j++)
twodim[n][m] = p1[j];
System.out.print( twodim[n][m]+" ");
m++;
if( m ==col)
m=0; n++;
System.out.println("@"+n);
System.out.println("m"+m+"n"+n);*/
public int markObject()
//System.out.println("boolean mark called");
mark_flg=1;
return mark_flg;
/*****************************************end of mdetect class*****************************************************/
/*********************************** Image Icon class ****************************************************************/
class PictureButton extends JFrame implements MouseMotionListener,MouseListener{
static Image image;Icon icon2;JButton button2=new JButton("hi"); int[] pixels; Container content;
public PictureButton(Image img ) {
super("PictureButton v1.0");
setSize(200, 200);
setLocation(200, 200);
Icon icon = new ImageIcon(img);
JButton button = new JButton(icon);
     button.addMouseMotionListener(this);
     button.addMouseListener(this);
button.addActionListener(new ActionListener( ) {
public void actionPerformed(ActionEvent ae) {
System.out.println("Urp!");
content = getContentPane( );
content.setLayout(new FlowLayout( ));
content.add(button);
     //content.add(button2);
public static void but(Image im) {
     image=im;
JFrame f = new PictureButton(im );
f.addWindowListener(new WindowAdapter( ) {
public void windowClosing(WindowEvent we) { System.exit(0); }
f.setVisible(true);
public void mouseMoved(MouseEvent e) {
//saySomething("Mouse moved", e);
public void mouseDragged(MouseEvent e) {
saySomething("Mouse dragged", e);
public void mousePressed(MouseEvent e) {
//saySomething("Mouse pressed; # of clicks: "
// + e.getClickCount(), e);
public void mouseReleased(MouseEvent e) {
//saySomething("Mouse released; # of clicks: "
// + e.getClickCount(), e);
public void mouseEntered(MouseEvent e) {
//saySomething("Mouse entered", e);
public void mouseExited(MouseEvent e) {
//saySomething("Mouse exited", e);
public void mouseClicked(MouseEvent e) {
saySomething("Mouse clicked (# of clicks: "
+ e.getClickCount() + ")", e);
void saySomething(String eventDescription, MouseEvent e) {
int w=0;int ind=0;
     System.out.println("The Object is at the point "+"x ,"+e.getX()+ "y" + e.getY());
     int[][][] imagePixels = imageIO.loadImage(image);
          final int MAXROWS = imagePixels.length;
          final int MAXCOLS = imagePixels[0].length;
          int[][] PixelArray = new int[MAXROWS][MAXCOLS];
          pixels=new int[MAXROWS*MAXCOLS];
          int cnt=0;
          int pix=0,pix1=0;
for(int row=0; row<imagePixels.length; row++) {
for(int col=0; col<imagePixels[0].length; col++) {
for(int rgbo=0; rgbo<4; rgbo++) {
               if((cnt<3)&&(rgbo<3))
w++;
               pix=pix+imagePixels[row][col][rgbo];
               cnt++;
               else
               {cnt=0;}
} // for rgbo
pix1 = pix/3;
pix = 0;
               /*if(col<97)
               {pix1=(byte)192;}*/
PixelArray[row][col] = pix1;
               System.out.print(pix1+" ");
} // for col
               System.out.println("@");
} // for row
     System.out.println("pix arr"+PixelArray.length);
     for(int ww=0;ww<MAXROWS;ww++)
     for(int hh=0;hh<MAXCOLS;hh++)
     pixels[ind++]=PixelArray[ww][hh];
     image = createImage (new MemoryImageSource( MAXROWS,MAXCOLS, pixels, 0, MAXROWS));
     System.out.println(" img added");
/********************************* end of Image Icon class**********************************************************/
this program will capture the video n play
if u click on the mark button processor will be stopped
u can click on the image and get the mouse co-ordinates
i have also got the pixel values of the current frame at which u had clicked the mark button..do some manipulation on the pixels to get ur stuff work
hope this will help u in some way
regards
sudha

Similar Messages

  • How to get the start Y position from IWaxLine

    Hello Everybody..
    When I enter the text in the textframe,
    the text's top position is not equal to textframe's top position(startYposition).
    I want to know that how to get text's top position.
    I guess that
    IWaxLine* waxLine  = waxIterator->GetFirstWaxLine(start);
    PMReal startYPosition = waxLine->GetYPosition () - waxLine->GetLineHeight ();
    but it is not true.
    I use Adobe Paragraph Composer
    When I use Adobe CJK Paragraph Composer the everything ok.
    But, I have to use Adobe Paragraph Composer.
    How can I solve this problem ?
    Thank you.

    .

  • How to get the current caret position of a field

    I would like to mimic a feature known from some UI parts in Eclipse (especially launch configurations) - inserting a predefined variable. It allows to modify the value of a text field by inserting a special value to the position of the caret.
    I'm struggling with how to get the caret position in Sapphire since the model does not propagate such UI-specific info. Is there a way how to implement this which does not involve creating a special field implementation?
    Thanks in advance.

    Sorry for the delay in responding. Currently, there is no API available to implement what you are describing. We should add a TextSelectionService similar to the existing ListSelectionService.

  • How to get the current cursor position in word report?

    I am generating a word report. But I would like to keep the table in one page. However, I did not find the way to do it in labview. Somebody would give me some suggestions? I appreciate a lot.
    One way I think I can do is to find the current cursor position. Since I know the table size so I can figure out if the left space in the current page is enough to hold the table. But I do not know how to locate the curent cursor position in word document in labview programmatically. I appreciate any suggestions on this question.
    Thanks.

    Hi,
    when you insert data in a word document you have to refer to bookmarks rather than cursor position.
    If you are using the Report Generation Toolkit for Office it is explained in the manual chapter 3-1.
    See also the example: Generate Report From Template (Word).vi included in the toolkit.
    If you aren't using the toolkit, you still have to refer to bookmark as reference points to insert and/or fetch data.
    The principle is:
    - First create a document in which you insert bookmarks where you wish and save it as a template
    - In LV open your template document and insert in it your data referring to bookmarks as insertion points
    - At the end save your report with another name, so you still have the template
    I hope I have been clear enough, if not just as
    k!
    Good luck,
    Alberto

  • How to get  the choice clicked by the user on a Confirmation dialog?

    Hi,
    'm trying with Confirmation dialog which should return
    'yes', 'No', or 'Cancel'
    I wrote like:
    String Message="Do u want  to update ??";
         IWDControllerInfo controllerInfo = wdControllerAPI.getViewInfo().getViewController();
         IWDConfirmationDialog dialog =wdComponentAPI.getWindowManager().createConfirmationWindow( Message, controllerInfo.findInEventHandlers("Yes"), "Yes");
         dialog.addChoice(controllerInfo.findInEventHandlers("No"),"No");
         dialog.addChoice(controllerInfo.findInEventHandlers("Cancel"),"Cancel");
         dialog.open();
    It works as a normal dialog window
    But how can I get the choice that is clicked by the user.
    ie . either 'Yes', 'No', or 'Cancel'.
    can any body help me
    thanks
    Smitha

    Smitha,
    In addition to your code, create 3 event handlers in your controller, name them Yes, No, Cancel. In every event handler you know what event was fired, i.e. what button is pressed.
    Valery Silaev
    EPAM Systems
    http://www.NetWeaverTeam.com

  • How to get the PDF Text position, font, size, align...?

    Hi~!
    I can extract all the text from the PDF file, but just plain text.
    I need their format, position, font, size, align.
    I am using C#, IAC, and read the SDK carefully.
    How to get them?
    Thanks for every hint on how to achieve this!
    Jason Wang

    "Often this is a rectangle, sometimes not (e.g. for italic text the box
    may be slanted too)."
    Sometimes it lines up with the horizontal axis, sometimes not.
    Aandi Inston
    =====================================================
    "Remember, in PDF, the origin is BOTTOM LEFT... "
    Leonard Rosenthol
    =====================================================
    Thank you, Aandi, Leonard, Thanks a lot
    Jason Wang

  • How to get  the mouse drag event ?

    I Have a JTextField and I want to move a selected text in the JTextField from a location to another by pressing the mouse on selected text and dragging it to newer
    location in the same text field (Same as Microsoft word does).Will u help me out please .

    But i can't get it working for the same component i.e dragging a text from the JTextField and dropping it in the same text field
    will u please help me with the sample code for 1 JTextField.I will really be very thankful to u
    Please

  • How to get the organized files back when you move to a new computer

    How to get your file folder organization back when you move to a new computer?

    Your PSE8 is using the default, new empty catalog that's created when PSE is installed.
    In Windows, search your entire computer for this file:
    catalog.pse8db
    The largest one that's found will be your old catalog.  If your computer people didn't restore that catalog file (and its entire directory), ask them where the heck it is.
    Ken

  • How to get the mouse's status ?

    Hello,
    Anybody knows call which API can reach to get mouse's status, not mouse position and click status I want , but its "Normal select" "Busy" "Working in background" etc status. thanks in advance.
    and I have made one "GetCurrsor" sample attached, but, it is not well, why the count would change at labVIEW front panel only, if the cursor is out of labVIEW front panel, it is no response. is anything wrong ?
    please help to point out.
    Attachments:
    Get_Cursor.vi ‏17 KB

    Yup, and I am going to that forums too (LAVA), but I found Gilbert have told us his last concern Clearly.
    Try to make everything Automatic

  • How to get the exact cursor position on Y-axis?

    The e.getYOnScreen() on MouseEvent not returning the exact position on the content pane! When I click at the (0,0) location in the JFrame, its returning (0,30).
    It may be the height of the frame title. How can I access the height of the JFrame title?

    baskaraninfo wrote:
    I have already tried adding MouseListener to frame as well as content pane. But, there is no significant difference.I have trouble believing this. Here where I add the mouselistener to the content pane, it works perfectly:
    import java.awt.Dimension;
    import java.awt.FlowLayout;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JTextField;
    class MousePositionTest2 extends JFrame
        private JTextField xPositionField = new JTextField(3);
        private JTextField yPositionField = new JTextField(3);
        public MousePositionTest2(String s)
            super(s);
            JPanel contentPane = (JPanel)getContentPane();
            contentPane.setPreferredSize(new Dimension(400, 400));
            contentPane.setLayout(new FlowLayout());
            contentPane.add(new JLabel("Click Location: "));
            contentPane.add(xPositionField);
            contentPane.add(yPositionField);
            xPositionField.setEditable(false);
            yPositionField.setEditable(false);
            contentPane.addMouseListener(new MyMouseListener());
        private class MyMouseListener extends MouseAdapter
            @Override
            public void mouseReleased(MouseEvent e)
                xPositionField.setText("" + e.getPoint().x);
                yPositionField.setText("" + e.getPoint().y);
                super.mouseReleased(e);
        private static void createAndShowUI()
            JFrame frame = new MousePositionTest2("MousePositionTest2");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.pack();
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
        public static void main(String[] args)
            java.awt.EventQueue.invokeLater(new Runnable()
                public void run()
                    createAndShowUI();
    }

  • How to get the button scale/position according to background?

    Hi
    My problem is that when I scale the browser window bigger the "facebok" button scales correctly according to background, but when I make the browser window smaller the button just stays in place...
    You can see it here: www.tihemetsamoto.ee just scale the browser window
    What should I do with the button?
    Best wishes
    Kristina

    Hey Elaine
    Thanks for your response I did a facebook button myself so it would fit with background (it's an image, which I made into a button) It right on the left side of the motorcycle on the ground on the main page
    Kristina

  • Get the mouse position

    If I have a frame and some panels on the frame, it seems I should not add the mouselisteners to the frame, but the panels. Now I can receive the mouse events. But when I try to get the mouse's position, they are the position's related to each panel. How can I get the positions associated with the frame?
    Thanks!

    public class MyFrame exyends JFrame implements MouseListener
    implement all the methods of Interface MouseListener
    e.g.
    public void mouseClicked (MouseEvent e)
    System.out.println("CLICKED AT " + e.getX() + "," + e,getY());

  • How to extract the mouse cursor image without using JNI

    I want to get the image of the mouse cursor of the system using java. The Robot class captures the screen only, but the mouse icon image is not the part of the screen, so it is not easily detected. But we can get the mouse cursor position using API, but how to get the exact image icon, without using JNI. I don't want to generate my own cursor at that position.

    I am building a Remote Desktop kinda app using java..... I want the screen of the remote comp to be viewed on my screen and generate events from my machine to the remote machine. So, I am capturing the screen images of the remote machine. But the cursor is not part of the screen object. i want to extract the cursor image icon from the remote machine to my machine and render the image.

  • How to throw the mouse event to a upper level component?

    For example: a panel using absolute layout, and there is a label on it.
    Now when mouse clicked on the label, i do not want the label but the panel to get the mouse event , so that i can get the mouse click point's x and y in the panel.
    How to implement it?
    Thanks a looooooooooooot for ur help
    Best Regards

    try this
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    class Testing extends JFrame
      public Testing()
        setSize(100,75);
        setLocation(300,200);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        final JPanel p = new JPanel();
        JLabel lbl = new JLabel("Click Me");
        lbl.setToolTipText("OK");
        lbl.setBorder(BorderFactory.createLineBorder(Color.BLACK));
        p.add(lbl);
        getContentPane().add(p);
        lbl.addMouseListener(new MouseAdapter(){
          public void mousePressed(MouseEvent me){//match method name
            p.dispatchEvent(me);}});
        p.addMouseListener(new MouseAdapter(){
          public void mousePressed(MouseEvent me){//with this method name
            System.out.println("Panel clicked");}});
      public static void main(String[] args){new Testing().setVisible(true);}
    }

  • Getting the absolute text position from a DOM tree

    Does anybody knows how to get the absolute text position of a node inside the DOM tree? Is there any DOM implementation that keep track of the absolute text position of each Node element or I need to overload somo methods by hand?
    Regards,
    Daniel Oliveira

    The position() function in XSLT returns the order of the element.
    For an xml document with elements:
    <a>
    <b></b>
    <b></b>
    </a>
    <xsl:apply-templates select="b"/>
    <xsl:template match="b">
    Element b:
    <xsl:value-of select="position()"/>
    </xsl:template>

Maybe you are looking for

  • Unable to Create/Update Forms in design console(OIM11G)

    I have installed 11g and configured client to a server that is running in the network. I am trying to create a new form from form designer, if I click on Save after giving the Table Name and Description. It is giving this error. Any suggestions? I tr

  • Time Machine not working in Bridge mode

    I have a AE6400 setup in bridge mode. The reason that it is in bridge mode is because I have my apple backup hardware on the other side and I believe having it in a Firewall mode would not allow this to work ( at least not easily). I have a client on

  • JRE/JDK 1.3.1_19 Not working with OS Patched Windows 2003 Server DST 2007

    Hello: We are trying to upgrade our 1.3.1_03 application with 1.3.1_19. It worked fine in a machine (WIndows Server 2003) where OS was not patched for DST. However, as far as I could see if the OS is patched the DST compliant java (1.3.1_19) is not w

  • How long does restoring iPhone 3GS take in recovery mode through iTunes?

    how long does restoring iPhone 3GS take in recovery mode through iTunes?

  • SetBindValue

    Is it posible to bind one value to multiple variables with DBMS_XMLQuery.setBindValue with out having to name all the variables differently In the case where I am using the same named variable twice. i.e. select role, granted_role from role_role_priv