Results 1 to 9 of 9

Thread: Java Digits

  1. #1
    Join Date
    Jan 2006
    Location
    Macedonia
    Beans
    58
    Distro
    Ubuntu 10.04 Lucid Lynx

    Java Digits

    Hi everybody.
    Is there a way to make in Java digits to look like digits from old calculators, like this:
    http://technabob.com/blog/wp-content...igit_clock.jpg

    and to be able to turn on and off some of the lines in the digit so I can make arrangements of them different than the arrangements of the existing decade numbers.
    Thank you
    Greetings

  2. #2
    Join Date
    Nov 2007
    Location
    New Zealand
    Beans
    1,026
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Java Digits

    Quote Originally Posted by tashe View Post
    Hi everybody.
    Is there a way to make in Java digits to look like digits from old calculators, like this:
    http://technabob.com/blog/wp-content...igit_clock.jpg

    and to be able to turn on and off some of the lines in the digit so I can make arrangements of them different than the arrangements of the existing decade numbers.
    Thank you
    Greetings
    This is called a seven segment display. Have a search around with google for "Java 7 segment display". Here is the first useful link I found.

    http://au.answers.yahoo.com/question...1085453AAdOisx

  3. #3
    Join Date
    Jan 2006
    Location
    Macedonia
    Beans
    58
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Java Digits

    Thanks for the reply.
    I tried it,but somehow I don't feel that it will work for me. My goal is to make a representation of the 0's and 1's in a digital signal. I think a line like the one below will be better, but I just don't know how to draw one. I know I can make it from more lines, but that makes the job ugly and more complex.
    Is there any way I can draw this picture with one line?
    Attached Images Attached Images

  4. #4
    Join Date
    Apr 2006
    Beans
    1,979
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: Java Digits

    It really depends on the application you're creating - is it GUI, command line, or what? Java has drawing toolkits which should do what you want.

    Alternatively you could do some clever string printing to the command line, which would be more complicated but way cooler.

  5. #5
    Join Date
    Jan 2006
    Location
    Macedonia
    Beans
    58
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Java Digits

    It should be a GUI.
    thanks for the replies

  6. #6
    Join Date
    Jul 2008
    Beans
    1,706

    Re: Java Digits

    i know theres a graphics object that can draw lines and stuff on your gui

  7. #7
    Join Date
    Nov 2007
    Location
    New Zealand
    Beans
    1,026
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Java Digits

    http://leepoint.net/notes-java/GUI-l...wingpanel.html

    The Graphics class contains various methods for painting.

    http://java.sun.com/j2se/1.5.0/docs/api/

    The above info should get you started.

  8. #8
    Join Date
    May 2006
    Beans
    471

    Re: Java Digits

    Quote Originally Posted by tinny View Post
    http://leepoint.net/notes-java/GUI-l...wingpanel.html

    The Graphics class contains various methods for painting.

    http://java.sun.com/j2se/1.5.0/docs/api/

    The above info should get you started.
    As noted in tinny's post, he suggested "painting". In which case the easiest way of doing this would be to find a font file online from somewhere and somehow incorporate it into your project.
    t.t.d.
    Segmentation Fault

  9. #9
    Join Date
    Jan 2006
    Location
    Macedonia
    Beans
    58
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Java Digits

    I'm almost at the end of the project. I did it with extending JFrame and using the g.drawline() method. At the end it turned out that it's easy.
    Thanks for the suggestions to everyone

Bookmarks

Posting Permissions

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