简体   繁体   中英

Java Swing - Touch Screen - L & F

I am developing a touch screen based application in Java (using Swing) for a Automat Machine something like this . As the operating system takes care of all the touch events, I just have to develop a desktop application and use it on the touch device.

I would appreciate if some can help me i) to remove the mouse pointer from the touch screen ii) and also to get a Look and Feel similar to the one should above (I use Ubuntu as Operating System and the look and feel is not so attractive)

Some Hint - But not complete

Iam developing a similar touch based fullscreen swing app and to hide the mouse cursor iam setting a transparent mouse pointer on my main frame window as follows:

int[] pixels = new int[16 * 16];
Image image = Toolkit.getDefaultToolkit().createImage(
        new MemoryImageSource(16, 16, pixels, 0, 16));
Cursor transparentCursor = Toolkit.getDefaultToolkit()
        .createCustomCursor(image, new Point(0, 0),
                "invisibleCursor");
mainAppFrame.setCursor(transparentCursor);

As for the look and feel iam actually using a custom extension of metal l&f where i have rewritten the ButtonUI paint method to get a JButton that look much like what you want. I would recommend you to try to do the same, is quite fun and not that difficult.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM