What's the definitive Java Swing starter guide and reference?

前端 未结 5 2187
半阙折子戏
半阙折子戏 2021-01-02 12:29

Obviously the Java API reference, but what else is there that you all use?

I\'ve been doing web development my entire career. Lately I\'ve been messing around a l

相关标签:
5条回答
  • 2021-01-02 12:38

    The Swing Tutorial is very good. Apart from that, the Swing API is obviously the reference, however it's also a treasure trove of fairly good source code! Add the API source to your IDE and you can jump directly to the implementation to all the Swing classes. This is a great way to explore the functionality, see how various Swing components work and learn a good Swing "style". Furthermore, it's great to be able to step through the API classes if things don't seem to work and you have no idea why! Adding the API source to the IDE has the additional benefit that you get all the JavaDocs along with it, although all modern IDEs can also pull them from the net -- you do not want to program desktop Java without the documentation available from within the IDE!

    NetBeans and other IDEs do make the creation of IDEs very easy, but be aware that there is a lot more to Swing than just containers and layout managers. In fact, containers and layout managers are among the easier things, and I'd recommend learning to use them by hand, too. There is nothing at all wrong with using a GUI builder, but in some cases it's overkill, and then it's nicer to just quickly whip up a GUI from source. In other cases you need to be able to create a GUI dynamically and then GUI builders are no use at all! For creating very complex layouts from source, I recommend FormLayout, which has its own set of quirks, but which does scale (in terms of programming effort) to very big frames and layouts.

    If you've only done Groovy so far, you'll be surprised how well documented Swing and the rest of the Java API is and how well everything is integrated. It might also take some getting used to a different style of programming, using the debugger more often and println-debugging less, etc. There might also be some "boiler-plate" code that will be very annoying. ;) Enjoy.

    0 讨论(0)
  • 2021-01-02 12:42

    I recommend you to play around with netbeans. It will allow you to build complete GUIs using only your mouse. Once you get familiar with Swing components, start using the Java API. Thats how I started.

    0 讨论(0)
  • 2021-01-02 12:55

    When it comes to developing java desktop applications, I would highly recommend using the IDE environment Netbeans. Especially when it comes to the development of Swing based applications.

    0 讨论(0)
  • 2021-01-02 12:58

    The O'Reilly Swing Book is a pretty good reference, it has a good overview of general Swing concepts and covers each of the major classes. I used it recently when I had to refresh my memory on Swing.

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

    The Sun Java tutorials are pretty good. I cannot vouch specifically for the Swing one as it has been ages since I've done any Swing development and I have not read it myself.

    Creating a GUI with JFC/Swing

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