Jump to content

Programming hardware in Java

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
ThemePark

ThemePark

    Programmer

  • Members
  • PipPipPipPip
  • 124 posts
I would like to figure out how to program for new hardware with Java. For example, if I have a new piece of hardware that I've made myself, or if I wish to build some code from scratch for something that already exists, like a touch screen or a keyboard.

But I am wondering how this is done, since there aren't any specific hardware classes, like a Mouse class. E.g. MouseListener works without having a Mouse field.

I'm not asking for code, but more for how it's done and should be done, and for guidance and steps to doing it. Also I would like to know the best way to go about this, so that I can write code that would work on all systems, just like Java code using a mouse for instance, and so that I don't need to have classes or fields for my hardware as such.

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Are you talking about creating a Windows driver in Java, or something else? Java's whole purpose is to hide the hardware from the programmer, so I'm a bit confused.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
ThemePark

ThemePark

    Programmer

  • Members
  • PipPipPipPip
  • 124 posts
Let's say that the ability to use a mouse wasn't coded into the JDK. So MouseListener, MouseAdapter etc. weren't available and the onClick method in MouseListener wouldn't work anyway.

So now I decide that I want to implement a mouse into Java, so that I essentially get what I have now. But since Java is completely clean of anything to do with mice because the mouse is a new invention, I have no idea of how to go about it. All I know is that I want to end up with a MouseListener, and an onClick method that actually works when I click the mouse. But I don't know how to link Java to the hardware.

That's of course a thought example, bĂșt that is essentially what I want to do. Implement some hardware my own way. I'm not looking for exact directions, but just which steps are necessary to do this.

#4
Lillian

Lillian

    Newbie

  • Members
  • Pip
  • 8 posts
Hi! What is Mouse listener...?