Turn photoshop design into Java GUI

后端 未结 2 570
伪装坚强ぢ
伪装坚强ぢ 2021-02-04 13:04

I can\'t seem to find anybody who has done or posted something like this; Essentially I want to design my own UI in photoshop and then slice down the images to use it in a Java

相关标签:
2条回答
  • 2021-02-04 13:13

    It depends on how far your design goes. If you simply want to have normal Swing components on top of your image this is easy. Convert your PSD into (for example) PNG, create a custom JPanel subclass that loads the image and overwrite the paintComponent() method to draw the image instead of the normal background. All child components can then be set to be transparent with setOpaque(false). This puts your image into the background and puts the components float on top of it.

    If you want to change how individual components look, its a lot more work. You basically need to implement a new Look&Feel for Swing. I wouldn't recommend going that route, unless you really have to, we are talking about weeks of work here, and it requires a lot of testing to really make it work properly on all platforms.

    Alternately, there are already tons of custom Look&Feels available, I suggest you take a look at some freely available ones (just google "java look and feel"). Many of them can be customized to some degree (how much depends on the actual implementation, so take a close look at the source/documentation for each of them).

    0 讨论(0)
  • 2021-02-04 13:28

    You might want to take a look at NetBeans which has a Swing GUI Builder. You would have to redraw your components there, and then write all the code to process the events. It is sometimes good to start with that, though often times it is less frustrating to lay them out with code by hand as it can difficult to make changes in code and have the builder keep up. There is nothing I know that will let you start from a photoshop image and proceed to building a GUI. Sounds like a good project to make someone rich. :-)

    0 讨论(0)
提交回复
热议问题