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();
}

Similar Messages

  • 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 exact time when condition records has been created?

    Hello All,
    Can anyone thorw some light on - how to find the exact time on which a particular condition record has been created?
    I have tried to get it from KONP {by inputting condition record number}, but unfortunately time is not tracked over there, but the date is tracked.
    Await your valuable inputs on the same.
    Regards,
    Hrishi

    Dear Hrishi,
    Try with this
    Go to display mode of the condition record through VK13 transaction from the condition record overview screen go to menu Environment >Changes>Click on Change report now system will take you to the Change Documents for conditions selection screen here you input proper selection data then execute now system will give the all the details here you can find the time also.
    I hope this will help you,
    Regards,
    Murali.

  • How to get the exact case of a local file

    Hi,
    I am using form 10g with webutil and have a local file called "Abc.sql".
    In my form, there is a input text and a button to let users to input the local file name and the press the button to upload it to
    the app server.
    What I want is : I can upload the file in the server with the exacl local file name. That means "Abc.sql" no matter users input
    "abc.sql" or "Abc.sql" in the input text.
    How to achieve this ? Is there any function provided to get the exact local file name ?
    For example, if I input "abc.sql" , it can return "Abc.sql".
    Thanks in advance
    Ivan
    Ivan

    Hello,
    How about simply let the user choose the file through a File selection dialog rather than take risk of end-user input typo ?
    Francois

  • 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 exact day date with the another date field?

    Hi,
    Please help me how to get the specific day of the week's date with the help of another date field.
    Actually , one field(week_day) has 1,2,3,4,5,6,7 here 1--MON,2-- TUE like that.
    another field has the date. based on that date, we have to go to that particular week and need to pick up the date by the above week_day. It should be in that week itself.
    Thanks in advance!!
    Regards,
    Vissu...
    Edited by: vissu on Oct 29, 2010 3:07 AM

    Hi,
    Something like this
    SELECT TRUNC(<DATE_COLUMN>,'DAY')+<WEEK_NO_COLUMN> FROM <YOUR_TABLE>;for the particular week of the date
    SELECT TRUNC(SYSDATE,'DAY')+<WEEK_NO_COLUMN> FROM <YOUR_TABLE>;for the current week
    cheers
    VT

  • How to get the Exact Measurement Values.

    Hi Scripters,
    I want to get the exact values shown in the Control Panel. Please see the screenshots below.
    I have written the JS code is here. But I want need the exact panel values in shown the above snapshots.
    var myImages = app.activeDocument.links;
    for(i = myImages.length-1; i >= 0 ; i--){
        var myImage = myImages[i];
        myImage.show();
        alert(String(myImage.parent.itemLink.parent.geometricBounds[3]-myImage.parent.itemLink.parent.geometricBounds[1]) + " × " + String(myImage.parent.itemLink.parent.geometricBounds[2]-myImage.parent.itemLink.parent.geometricBounds[0]));
    thx,
    csm_phil

    There are 12 points in a pica.
    You need to divide the points by 12 and tack the modulus of 12 onto that:
    function getPicas(points){
        return "" + Math.floor(points/12) + "p" + points%12;
    alert(getPicas(504));
    alert(getPicas(104.16));

  • How to get the exact Height and width of the text in TextLayout Framework

    Hello fellow developers,
    I start working with TLF when there is three different SWC's Now I am working with Single SWC with flex 4 and lot of things are changed like
    I use calculateHeight(),calculateWidth()  now these methods are not available.
    Please if anyone know the replacement of these methods then Let me know.
    thanks

    If the text exceeds the container, which can happen in a scrollable container where you have to scroll to see some of the text, then the values getContentBounds returns are estimated values. This is because we don't want to force the text to recompose all the way to the end of a very long TextFlow in order to return a value. However, if you want to get the exact amount, and don't mind taking the time to recompose, call textFlow.flowComposer.composeToPosition(), before calling getContentBounds. This forces all the text to recompose to the end, and then getContentBounds will return the fully calculated value instead of estimating.

  • 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 'hand' cursor on an ALV drill down report?

    I have a drill down on PO # going to trans ME23N that is working great.
    But I have noticed on my other drill downs (E.G for billing doc VF03) that when the report is displayed the drill down field value is a) underlined and b) has a 'Hand' appear when you place the cursor over the billing document field.
    This does not happen on my PO # - it is not highlighted with an underscore, nor do you get the small hand  - but it does work when you double click the field.
    The field I am using on the ALV report is RSEG-EBELN.  This is not a KEY field in the table - perhaps that is why it does not have the underscore and the 'hand'.
    Thanks!
    Scott

    Here it is.
    When you build your field cat use the below code.
    DATA : x_fieldcat TYPE slis_fieldcat_alv.
    * Single click on the field will trigger double click event.Also, a hand
    * will appear when the cursor navigates to the field
      X_FIELDCAT-HOTSPOT = 'X'.
    Regards,
    ARS

  • How to get the exact decimal places displayed while exporting to Excel?

    Hi All,
    I have a requirement to display the exact decimal place values in my report. In my pivot table, i duplicated a column named order number and converted to percentage by applying these conditions Show Data As-> Percent Of-> Column. I got a resultant column with one decimal point. As i needed two decimal points i took the xml of the report and changed the minDigits='2' and maxDigits='2' values like this. After that i got the accurate answer. But when i export it as excel sheet it is not showing the % column properly. The values after 0 is not getting displayed. Any solution for this?
    Thanks in Advance
    Thenmozhi

    Hi Thenmozi,
    You can try adding the below statement in the Custom CSS section of the your column properties.
    mso-number-format:"\@"
    Edit your report--> Criteria-->which column you want to display in excel click column properties --> select CCS--> Paste here above code.
    Second way:
    Edit your report --> criteria-->click fx option for your column and apply the below code.
    2. '<span style="display:none">&nbsp</span>' || CAST(your column name AS CHAR)
    Award points it is useful.
    Thank,
    Satya

  • 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

  • Hi, Can anybody tell me how to get the exact measurement of a curved line in illustrator?

    I am using the ruler tool, but it only gives me the width, height, x and y axis measurements. I need to find out the exact measurement of a curved line. Any help would be greatly appreciated! thanks

    open the Document Info window, select your line and pick Objects from the drop-down menu

  • How to get the exact sql developer which used for data migration?

    Hi all,
    Hope doing well,
    Sir i seen a link for data migration that is : http://www.oracle.com/technetwork/developer-tools/sql-developer/sql-server-connection-viewlet-swf-089886.html
    in this link when they are connecting to sql database so after clicking on new connection four tab is showing that is oracle, access, my sql, sql server.
    i downloaded latest version of sql developer which version is: 3.02.09.30 when i opened this i am not getting those option.
    and one more thing i am not getting miragation menu name in menu items.
    please help me.
    thanks and regards

    Hi,
    To connect to non-Oracle databases from SQL*Developer youneed to download the relevant JDBC driver.
    This is detailed in the documentation in the User Guide -
    http://docs.oracle.com/cd/E35137_01/appdev.32/e35117.pdf
    in the section -
    Database: Third Party JDBC Drivers
    The Third Party JDBC Drivers pane specifies drivers to be used for connections to third-party (non-Oracle) databases, such as IBM DB2, MySQL, Microsoft SQL Server, or Sybase Adaptive Server. (You do not need to add a driver for connections to Microsoft Access databases.) To add a driver, click Add Entry and select the path for the driver:
    ■For IBM DB2: the db2jcc.jar and db2jcc_license_cu.jar files, which are available from IBM
    ■For MySQL: a file with a name similar to mysql-connector-java-5.0.4-bin.jar, in a directory under the one into which you unzipped the download for the MySQL driver
    ■For Microsoft SQL Server or Sybase Adaptive Server: jtds-1.2.jar, which is included in the jtds-1.2-dist.zip download
    ■For Teradata: tdgssconfig.jar and terajdbc4.jar, which are included (along with a readme.txt file) in the TeraJDBC__indep_indep.12.00.00.110.zip or TeraJDBC__indep_indep.12.00.00.110.tar download
    To find a specific third-party JDBC driver, see the appropriate website (for example, http://www.mysql.com for the MySQL Connector/J JDBC driver for MySQL, http://jtds.sourceforge.net/ for the jTDS driver for Microsoft SQL Server and Sybase Adaptive Server, or search at http://www.teradata.com/ for the JDBC driver for Teradata). For MySQL, use the MySQL 5.0 driver, not 5.1 or later, with SQL Developer release 1.5.
    You must specify a third-party JDBC driver or install a driver using the Check for Updates feature before you can create a database connection to a third-party database of that associated type. (See the tabs for creating connections to third-party databases in the Create/Edit/Select Database Connection dialog box.)
    Regards,
    Mike

Maybe you are looking for

  • Is it possible to make an  animated drop down menu  and still use  the menu widget?

    Hi- I am trying to create a menu bar that is hidden with just a tab exposed  to indicate that there is a menu  there. Upon  rollover,  the full menu bar slides down and reveals the menu items.  I can't find a way to make it smoothly  slide down so I

  • GSView doesn't work for me

    Hello everyone, I try to get Geany-latex with gsview working because I don't like xdvi. I made a very simple latex file, only containing "Hello World" \documentclass[a4paper,10pt]{article} \usepackage[utf8]{inputenc} \title{Auswertung des Fluglabors

  • Changes in sales order

    Hello, Table VBUK is for order header status. I made changes to sales order. which field in table indicates sales order change Date & Time? thanks

  • Budget effected for current year for changing a PO of last year

    Dear Controlling firends, I am a MM guy and facing the titled difficulty. The problem is ,suppose a Po had been created in last fiscal year and at that time budget for last year has been consumed as committed. But now when I am changing that particul

  • The CompileSPL.exe in the Lync Server 2013 SDK can't compile the application manifest file

    My windows server version is 2012 standard, I deployed the lync server 2013 to my environment, and ran the lync server 2013 SDK on the front end pool. Today, I wanted to compile a application manifest file, but I got the warning that this app can't r