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.
Programming hardware in Java
Started by ThemePark, Jan 15 2010 08:17 PM
3 replies to this topic
#1
Posted 15 January 2010 - 08:17 PM
|
|
|
#2
Posted 16 January 2010 - 05:42 AM
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.
#3
Posted 16 January 2010 - 11:05 AM
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.
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
Posted 19 January 2010 - 03:01 AM
Hi! What is Mouse listener...?


Sign In
Create Account


Back to top









