File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes This week's book giveaway - Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "This week Watch "This week New topic
Author

This week's book giveaway - "Swing"

Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

This week we are giving away Swing (2nd edition). Plus the authors, Matthew Robinson and Pavel Vorobiev, are going to be here in the "Swing / JFC / AWT" forum here on JavaRanch!

Be sure to give them a big JavaRanch "Howdy!" (and try to give them your <i>really</i> hard Swing questions!)

Make sure that you are registered and that your posts are on topic so you will be in the running for the free books! (For details check out JavaRanch Book Promo)

A big thanks to Manning for the books!


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
M.K.A. Monster
Ranch Hand

Joined: May 02, 2002
Posts: 130
Howdy howdy howdy.
Let's Swing this Javaworld.
Regards,
Mark Monster
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
Welcome.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Does the book cover design patterns in GUI development? I don't mean just MVC but patterns like mediator, command, etc..
I checked the book description at Amazon but it only mentioned MVC.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

I am also wondering what kind of patterns you cover, but I am looking for Action and Command patterns. I have yet to find a book that covers these patterns AND gives good examples of them used in a SWING App. It is discouraging because I am trying to learn these patterns. How much does your book go into that? And what kind of examples?


GenRocket - Experts at Building Test Data
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
This is an April Fools Joke - isn't it?
These guys are not REALLY going to show up are they?


"JavaRanch, where the deer and the Certified play" - David O'Meara
Matthew Vorobiev and Pavel Robinson
Greenhorn

Joined: Apr 01, 2003
Posts: 1
Ummmm... of course we are! Aaaaaa... Swing is really cool and everyone should use it. Oops, gotta go!
Matt Robinson
author
Greenhorn

Joined: Apr 30, 2001
Posts: 16
For better or for worse at least one of us is here
To answer your question on patterns, we don't cover ANY of them - sorry. For the same reason we dropped several other topics -- the book was getting too fat. This wasn't entirely our decision, the publisher asked us to select 4 chapters to drop from the first edition so we really had to stick to the core library this time around.
Sounds like a good idea for a separate book or at least a few articles..
Regards,
-Matt


Matthew Robinson
co-author of Swing Second Edition (2003, Manning Publications).
Younes Essouabni
Ranch Hand

Joined: Jan 13, 2002
Posts: 479
Thx for your answer Matt, could you take a look at this thread plz.
Sorry to hijack this thread.
Thx in advance


Younes
By constantly trying one ends up succeeding. Thus: the more one fails the more one has a chance to succeed.
sing
Ranch Hand

Joined: Nov 29, 2001
Posts: 121
Hi Matt,
Do you means it's not cover Timer as well? I have study from "The JFC Swing Tutorial" but i still have no idea to use Timer.
Can you give me some idea if i want to control a Swing class loop itself in main method?
public static void main(String[] args) {
JFrame frame = new TestLoopFrame();
}
Thank You.
steffy
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

Originally posted by Matt Robinson:
For better or for worse at least one of us is here
To answer your question on patterns, we don't cover ANY of them - sorry. For the same reason we dropped several other topics -- the book was getting too fat. This wasn't entirely our decision, the publisher asked us to select 4 chapters to drop from the first edition so we really had to stick to the core library this time around.
Sounds like a good idea for a separate book or at least a few articles..
Regards,
-Matt

So any information on some good links or books where we can find some good examples/tutorials on using command and action patterns with SWING?
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Matt Robinson:
Sounds like a good idea for a separate book or at least a few articles.

Yes, please! I have yet to find a pattern book for Java GUIs. I've always managed to hack the functionality but the code has been somewhat ugly...
Could you write such a book for, say, next week?
sing
Ranch Hand

Joined: Nov 29, 2001
Posts: 121
Hi Matt,
I've always managed to hack the functionality but the code has been somewhat ugly...

I have same problem as Lasse. Sometimes, i really hate to look to my ugly Swing program.....
Although I always keep away myself to Swing but I still hope I can code it nicely...Can you give some guideline or pattern to code Swing nicely?
steffy
sing
Ranch Hand

Joined: Nov 29, 2001
Posts: 121
Originally posted by Gregg Bolinger:

So any information on some good links or books where we can find some good examples/tutorials on using command and action patterns with SWING?

I have brought "The JFC Swing Tutorial" by Kathy Walrath & Mary Campione but you can also read the
Tutorial on Java Sun Website
steffy
Jonathan Gerrish
Greenhorn

Joined: Mar 25, 2003
Posts: 24
Hiya, does it cover any of the HCI/cognative issues involved in GUI design? I'm particually interested this. For example how to lay out components etc to make the GUI intuative + promote a good user experience.
Otherwise anyone have any good links on the topic?
All the best, Jon
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Steffy Sing:
..."The JFC Swing Tutorial" by Kathy Walrath & Mary Campione...

I've browsed through the Swing Tutorial at java.sun.com some time ago but as far as I can remember, it didn't say a word about patterns or best practices. Has this changed? Then the whole tutorial was about "how to use the API" kind of information.
Matt Robinson
author
Greenhorn

Joined: Apr 30, 2001
Posts: 16
Originally posted by Gregg Bolinger:

So any information on some good links or books where we can find some good examples/tutorials on using command and action patterns with SWING?

The Action architecture seems to be by far the most written about example of this:
http://java.sun.com/products/jfc/tsc/articles/actions/
http://www.javaworld.com/javaworld/jw-06-2002/jw-0628-designpatterns.html
Do a Google search for "command pattern swing"
[ April 02, 2003: Message edited by: Matt Robinson ]
Matt Robinson
author
Greenhorn

Joined: Apr 30, 2001
Posts: 16
Originally posted by Steffy Sing:
Hi Matt,
Do you means it's not cover Timer as well? I have study from "The JFC Swing Tutorial" but i still have no idea to use Timer.


Timers are covered and an example in chapter 2 at http://www.manning.com/sbe should answer your question
Matt Robinson
author
Greenhorn

Joined: Apr 30, 2001
Posts: 16
Originally posted by Jonathan Gerrish:
Hiya, does it cover any of the HCI/cognative issues involved in GUI design? I'm particually interested this. For example how to lay out components etc to make the GUI intuative + promote a good user experience.

This is briefly touched upon in our "UI Guidelines" in each chapter (written by a User Interface design expert, David Anderson). However, it by no means covers good user interface design beyond basic recommendations. The only book I could personally recommend in this area is Designing Visual Interfaces - communication oriented techniques, Kevin Mullet and Darrell Sano, Sunsoft, Prentice Hall, 1995. But this is probably higher level than what you are looking for.
Younes Essouabni
Ranch Hand

Joined: Jan 13, 2002
Posts: 479
Could you give us an advice about best practice to handle events. Is it better to handle all events in one separate class (that's what I'm doing, it's allowing me to share behaviours but the class becomes quickly heavy), or is it better to have a handler per class?
Thanks in advance, we won't let you sleep
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Younes Essouabni:
Could you give us an advice about best practice to handle events.

...and how to design access to different parts of the GUI -- accessor methods versus protected members, etc.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

Originally posted by Matt Robinson:

The Action architecture seems to be by far the most written about example of this:
http://java.sun.com/products/jfc/tsc/articles/actions/

Ah, a typical Sun article. A lot of background information and links but hardly any explination of the given code.

http://www.javaworld.com/javaworld/jw-06-2002/jw-0628-designpatterns.html

Ok, in regards to this example:
How is doing that any better design wise than just saying:

The code in the example from the Javaworld Article acheives the exact same result just a bit differently. I don't see any advantage of one over the other and isn't that the point in design patterns? That they are supposed to give better advantages?
Greg Ostravich
Ranch Hand

Joined: Jul 11, 2002
Posts: 112
What about Layout Managers?
I know they are more AWT specific but if you have anything on GridBag that would be great.
I never really got the hang of it.
I haven't done a lot with Swing lately - are there new Layout Managers?
Are there new Swing features in 1.4?


Greg Ostravich - SCPJ2
Shane Roylance
Ranch Hand

Joined: Aug 29, 2001
Posts: 72
Hi Matt,
I was wondering if the book covered the new printing API at all. It's a subject that I am having a hard time finding anything about. (Is that considered part of swing?)
Thanks
Shane
[ April 02, 2003: Message edited by: Shane Roylance ]
Pam Ginther
Greenhorn

Joined: Jul 10, 2002
Posts: 10
Good Morning,
I am working on my first swing application and I am creating a table that will hold detail items from an order. I want to be able to do the methods in the AbstractTableModel but I also need to be able to add a blank row like in DefaultTableModel. The sun javadoc's do not recommend the use of DefaultTableModel. Question: What table model should I use that will allow me all of the capabilities that I need?
Thank you in advance for your time!
Pam Ginther
jam bingo
Greenhorn

Joined: Apr 02, 2003
Posts: 2
i, for one, would really like to see Swing as it relates to JApplets discussed... i recently wrote a java chat server and client, with the client utilizing Swing components via the JApplet extension of the standard awt Applet class...
sure would like to get a reference for JApplet/Swing questions...
anyone else using JApplet for anything?


best.<p>hive_slave<br />dude!!! sweet!!! dude!!! sweet!!!
Younes Essouabni
Ranch Hand

Joined: Jan 13, 2002
Posts: 479
Originally posted by Shane Roylance:
Hi Matt,
I was wondering if the book covered the new printing API at all. It's a subject that I am having a hard time finding anything about. (Is that considered part of swing?)
Thanks
Shane
[ April 02, 2003: Message edited by: Shane Roylance ]

Hi Shane, from this URL we may see that it cover the Printing.
Happilly, the printing is one of the free chapters that you may consult from the website

[ April 02, 2003: Message edited by: Younes Essouabni ]
Shane Roylance
Ranch Hand

Joined: Aug 29, 2001
Posts: 72
JAVA 1.4As of Java 1.4 there is a new javax.print package allowing more detailed control of print jobs and communication with printers. Coverage of this new package is beyond the scope of this book, as it is deserving of a much more extensive treatment than we can provide here. This chapter should be considered a primer on printing with Swing, and for those issues that cannot be solved using the material here we would suggest digging into the new javax.print package.

That's a quote from this book. Does anyone know of any kind of documentation on the javax.print package???
Thanks
Shane
Rob Hunter
Ranch Hand

Joined: Apr 09, 2002
Posts: 828
Hey and Howdy,
Never had time to read through all the postings here but does your book cover anything in relation to printing to a printer? Interaction between java and other languages? Also I was curious to see which aspects of using Swing components and java's AWT you found to be most interesting and which you found to be most "useful" in real-world applications? Sorry I don't have any real challenging questions, just questions more of interest. Thanks.
Rob
Vedhas Pitkar
Ranch Hand

Joined: Jan 27, 2001
Posts: 445
Hi!Looking forward to winning your Book!
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Hey guys, don't put all your questions in here! Open up new threads for your questions... the rules are that no posts in this thread count towards the contest!


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Don't going listening to Thomas now, just stay in there, all nice and cozy like.


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Francis Siu
Ranch Hand

Joined: Jan 04, 2003
Posts: 867
hihi
Thomas VS Barry
Who will win?
Just for fun,do not angry


Francis Siu
SCJP, MCDBA
Michael Roach
Greenhorn

Joined: Apr 03, 2003
Posts: 1
Originally posted by Matt Robinson:
[QB] To answer your question on patterns, we don't cover ANY of them - sorry. For the same reason we dropped several other topics -- the book was getting too fat. This wasn't entirely our decision, the publisher asked us to select 4 chapters to drop from the first edition so we really had to stick to the core library this time around.

What were the topics of the other three chapters that were eliminated?
[ April 03, 2003: Message edited by: Michael Roach ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: This week's book giveaway - "Swing"