Results 1 to 1 of 1
- 12-15-2012, 11:04 PM #1Member
- Join Date
- Dec 2012
- Rep Power
Extending GraphicsDevice for driver
I'm working with Java in an e-reader. I have an EInkDisplay class I'm using as a screen driver, containing a repaint(Rectangle) method and a getGraphics() method. I have another class, TouchDriver, capable of receiving touch events from the screen and generating MouseEvents for listeners. I'm working on a virtual keyboard so I can have keyboard input too.
In other words, I have the capabilities to create a non-headless GraphicsEnvironment. However, I'm not sure how to proceed with taking the above classes and generating a GraphicsDevice that I can use with Swing. Nowhere in the GraphicsDevice documentation does it give me a method to override and pass back the Graphics object that EInkDisplay provides me with.
Currently, whenever I attempt to instantiate a JFrame, I get a HeadlessException because the system does not recognize the E-Ink screen as an output device. I can definitely write to it, though; it's just a matter of formalizing it so Swing can understand.
Given the EInkDisplay and TouchDriver classes, how might I go about creating a GraphicsDevice or GraphicsEnvironment so I can generate a JFrame using new JFrame(GraphicsEnvironment)?
Alternately, if I could create a GraphicsDevice or GraphicsEnvironment and tell Java to use the Linux framebuffer at /dev/fb0, I'd be equally happy.
Last edited by ryanthejuggler; 12-15-2012 at 11:38 PM.
- By santde in forum JDBCReplies: 0Last Post: 03-03-2012, 02:01 AM
- By Alkor in forum New To JavaReplies: 5Last Post: 02-26-2012, 02:18 AM
- By GavinCash in forum New To JavaReplies: 10Last Post: 10-11-2010, 08:07 AM
- By tedley24 in forum AWT / SwingReplies: 2Last Post: 08-24-2010, 05:48 PM
- By eva in forum New To JavaReplies: 2Last Post: 12-24-2007, 10:49 AM