Kathy Walrath

Author
+ Follow
since Apr 26, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Kathy Walrath

It looks like you're waiting in the event thread, which stops all event-processing and painting in the app. What you should use instead is a Swing Timer. You can find information about Swing Timers here:
http://java.sun.com/docs/books/tutorial/uiswing/misc/timer.html
In fact, there's some code in there which is very close to what you need -- it performs an action once a second for as long as there's anything to do.
[ April 29, 2004: Message edited by: Kathy Walrath ]
20 years ago
Anyone can write or use any custom layout manager, though sometimes it takes a bit of doing to make it work right. You just need to write a class that implements LayoutManager interface (or, optionally, its subinterface LayoutManager2). This page has more information, along with two examples of custom layout managers:
http://java.sun.com/docs/books/tutorial/uiswing/layout/custom.html
20 years ago
I believe you need to look into input methods. One link that looks promising is this one:
http://developers.sun.com/dev/gadc/technicalpublications/presentations/iuc22_thai_hindi.pdf
[ April 28, 2004: Message edited by: Kathy Walrath ]
20 years ago
Sharon answered well. The only thing I'd add is that I believe AWT components are fully accessible now. Still, Sun strongly recommends using Swing instead of AWT whenever possible. My guess is that accessibility was the last feature added to the AWT components. Swing components, on the other hand, are actively being improved and extended.
20 years ago
Swing can be fast for complex apps too -- faster than apps with native components, actually -- if you take advantage of the separable model architecture. For example, if you have a mess of data changes, then it's much faster to make them to the data model (of a table or list, say) and then flush the data out to the component than it is to update the values in the component one by one. Some component architectures don't give you that option.
20 years ago
No, we don't cover the "right" way to design an app. The Swing team is aware of the need for a blueprint, and they are working on some recommendations. It's going to take a while, unfortunately. When there's any news on this front, it'll be posted on javadesktop.org.
20 years ago
It covers customizing components in general, but not customizing buttons in particular. As for the level, I'd call it a beginner-to-advanced book that covers a lot of topics, but not usually in depth. More info is in my post in the Book Topics Covered topic. (I hope that link works.)
20 years ago

Originally posted by Paul Santa Maria:
The first edition of "JFC Swing Tutorial" was really, really great! I much prefer books to on-line tutorials for "getting up to speed" on any topic of a complexity that requires more than a page or two (I can highlight, I can make notes, I can bookmark, I can more easily flip forwards and backwards, etc etc), the the first edition of "JFC" excelled at the breadth of material, the mix of short examples vs long examples vs explanatory sidebars that make books a preferred medium for a topic as big as JFC/Swing.


I forgot to mention: Thanks! It's great to hear that the book format worked well for you. I hope the new layout works as well or better.
20 years ago
  • It covers the very latest APIs: 1.4.2 (e.g. it covers the GTK+ look and feel), with tips about features expected in 1.5.
  • It's from Sun and was reviewed by the engineers that work on Swing.
  • It's designed to be quickly accessed -- dive in, dive out.
  • It's incorporated much reader feedback from over the years.
  • It's based on a website, so you don't check have to buy the book to get the information, but if you do you can use it in whichever form is more convenient, and you can check for updates easily.


  • [ April 27, 2004: Message edited by: Kathy Walrath ]
    20 years ago

    Originally posted by Ayesha Bux:

    So this is the most up-to-date Swing book available.


    I hadn't thought of it that way, but yep, it probably is.
    20 years ago
    Hi,
    To answer the second post first, the book has snippets from about 150 examples. Our books used to have a code appendix with the complete code printed, but when we surveyed our readers, a majority indicated that they'd
    rather have a smaller book than one with complete listings.
    All the examples exist in complete, runnable form on the CD that comes with the book and on the web. All but a few of the examples can be run using Java Web Start over the web.
    The CD also has the 1.4.2 version of the J2SE and the API doc, and a PDF copy of The Swing Connection. All this stuff is available in one form or other at java.sun.com. The book is basically a cleaned up version of http://java.sun.com/docs/books/tutorial/uiswing/ , optimized for printing and with a TOC, bleeding tabs, index, CD, and everything else we could do to make it convenient to use in book form. You can look at the book contents or the Swing trail contents (which have links to pages) to get a better idea. (Note that the book ordering is different, but the information contained is the same, except for the level of polish.)
    In general, the book (like the website it's taken from) gives definitive instructions for performing common tasks. It doesn't go into great depth on most topics, but it covers a wide range of topics and has examples for everything.
    It also provides some handy code to reuse -- for example, it includes a table column sorter, drag-and-drop recipes, and a password entry panel.
    Many people (including me) don't like to read/print reams of information from the web, or like to be able to read stuff while they're away from the computer. They're the people we expect to buy the book.
    The book is for both beginners and experienced engineers. The engineers in the Swing, 2D, i18n, and AWT groups have been grabbing copies, for example, and they ain't beginners. It's just handy to have the book around when you're trying to do something you haven't done in a while, or when you're wondering what the "right" way is to do something. As my co-author Sharon mentioned in another post, the engineers reviewed the book, so you know you're getting the straight poop. (Though she used an unscatological yet JavaRanch-appropriate horsy metaphor.)
    [ April 27, 2004: Message edited by: Kathy Walrath ]
    20 years ago
    Thanks for the welcome! I need to take care of work and personal stuff during the day, but I'll log back on in the evening to reply to everyone's posts.
    20 years ago