开发者

Java Swing - Touch Screen - L & F

开发者 https://www.devze.com 2023-03-26 06:51 出处:网络
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 d

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 lo开发者_如何学编程ok 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号