Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: How to get mouse coordinates on the console screen in Bluej

  1. #1
    Junior Member
    Join Date
    Aug 2019
    Thanked 0 Times in 0 Posts

    Question How to get mouse coordinates on the console screen in Bluej

    I want to make a personnel project in which I change the crappy CUI console screen of BlueJ to GUI based using only core java. The logic I formulated is that I'll take the position of the cursor and check for a button press. If the button press is done when the cursor is above some specific pixels, It will call a specific method. Taking coordinates is easy but the problem lies in checking for button presses. Methods I saw online were using JFrame but I don't want to use it since I want the backdrop to be the console screen.

    Example - User clicks on a piece of text like go to next page, The logic is that when his cursor clicks on that set of pixels(Let's say it expands from (450,135) to (500,150) It will call a method containing the reference of let's say the next page of the book)


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Eastern Florida
    Thanked 2,710 Times in 2,660 Posts

    Default Re: How to get mouse coordinates on the console screen in Bluej

    checking for button presses
    That's often done with a key listener.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. [SOLVED] Adjust screen size and button arrangement for any computer screen
    By Prathiksha in forum AWT / Java Swing
    Replies: 4
    Last Post: April 23rd, 2014, 11:11 AM
  2. coordinates (GUI)
    By Django in forum What's Wrong With My Code?
    Replies: 0
    Last Post: March 8th, 2013, 10:24 AM
  3. Java Coordinates
    By qspec in forum Java Theory & Questions
    Replies: 1
    Last Post: September 13th, 2012, 10:15 PM
  4. Replies: 1
    Last Post: May 5th, 2012, 05:00 PM
  5. Replies: 9
    Last Post: December 31st, 2011, 01:22 AM

Tags for this Thread