Results 1 to 3 of 3
  1. #1
    DFTBA is offline Member
    Join Date
    Jun 2012
    Rep Power

    Default Draw outside JFrame

    I need to be able to make a line right on my computer screen without using a JFrame. I am using Java.awt.Robot's getPixelColor, and would like to draw a "crosshair" on the screen to tell me what pixel is being tested. Therefore, I need to draw a line on the screen without JFrame. If you have a different solution to the problem, feel free to share. I'm not set on the crosshair idea. If you have a different way I can see what pixel is being tested, that would also work. I just need the crosshair to set up my program for the correct coordinates to test, because I don't know yet where the pixel is that I am testing. So if you have a way to get the coordinates of a pixel I click on, that would work too.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Blog Entries
    Rep Power

    Default Re: Draw outside JFrame

    If I were the one creating an application similar to this, I don't think that I'd use Java to do it, but rather a language that could allow closer interaction with the operating system such as C or C++. Your mileage may vary.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

    Default Re: Draw outside JFrame

    If you've updated to Java 7 (or at least 6u10), you could try using a transparent window: How to Create Translucent and Shaped Windows (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Other Swing Features)

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 3
    Last Post: 11-27-2011, 06:18 AM
  2. Replies: 13
    Last Post: 09-29-2010, 11:55 PM
  3. Replies: 5
    Last Post: 06-14-2010, 07:10 PM
  4. Replies: 4
    Last Post: 04-23-2009, 12:02 AM
  5. How do you draw a grid in a JFrame
    By Singing Boyo in forum New To Java
    Replies: 2
    Last Post: 03-11-2009, 03:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts