Books On Swings

Hai all,
Can you suggest me some books that i can read through on Swings?
I am a beginner and working on a project based on Swings.
Expecting your suggestions soon.
Thanks in advance.

try the swing tutorial first
http://java.sun.com/docs/books/tutorial/uiswing/

Similar Messages

  • Book on swing needed

    can anyone tell me some good books on swings
    i have oriely book on java swings
    also if anyone needs it do tell me i have the link to it

    can anyone tell me some good books on swings Why did you post here?
    i have oriely book on java swingsWhat's wrong with the O'Reilly books?

  • Best Book for Swing Programming

    Can anyone tell me the name of a swing related book which covers all the major topic of swing programming.
    Thanks in advance

    I like Java Swing from OReilly. Big thick book, and contains nothing but Swing.

  • Best Book for Swings

    Hi all,
    I am searching for a good book in Java Swings which explains from basics to most complex.
    Please give ur suggesitions.
    thanx
    amar

    Sure :
    http://www.amazon.com/exec/obidos/tg/detail/-/193011088X/qid=1081969499/sr=1-2/ref=sr_1_2/002-2220942-6124804?v=glance&s=books
    Publisher: Manning Publications Company; 2nd edition (February 2003)
    ISBN: 193011088X

  • Book on Swing

    I am looking to buy a good book focusing on Swing. Any suggestions? One that I am looking at is "Swing, Second Edition" by Matthew Robinson, Pavel Vorobiev. Is this one any good or are there better ones?

    I've been using the Robinson book and I find it to be excellent. The O'Reilly book is also good, though I'm not as familiar with it as I am with the Robinson book.
    The O'Reilly book does have a section on the UIManager keys, which I haven't seen elsewhere.
    The Robinson book has the best coverage on printing that I've seen.

  • New oreilly book on swing

    its about time! anyone looking foward to this ?
    http://www.amazon.com/exec/obidos/ASIN/0596004087/qid=1036172829/sr=2-1/ref=sr_2_1/002-8059781-3585653

    I've been using the Robinson book and I find it to be excellent. The O'Reilly book is also good, though I'm not as familiar with it as I am with the Robinson book.
    The O'Reilly book does have a section on the UIManager keys, which I haven't seen elsewhere.
    The Robinson book has the best coverage on printing that I've seen.

  • Good book on Layout Managers...

    Hi,
    I am looking for good book on Swing. I needed to be a lot of things: a good reference, good explanations, good explanation about how Layout managers work and how to design GUIs.
    One of the biggest problems that I am having is, I think, not understanding how to layout my components and how to control each component so that the GUI doesn't look rediculous. So, I need a general explanation as well as a detailed, all in one.
    Does anyone know of a book or a set of books that would do this?
    Thanks,
    Yaakov.

    Core JFC (2nd Edition) by Kim Topely has a good section on gridbag. I really like this book. For more current books, try Java Swing, Second Edition by James Elliot et al and Swing, Second Edition by Matthew Robinson et al.
    As for layout managers, we've been using RelativeLayout and are very happy with it. Coding it is rather wordy and tedious, but it makes a lot more sense to us than gridbag's wacky concepts (weights, invisible grids with insets etc). I find it much more precise for positioning components than gridbag. Our new Swing programmers understand RelativeLayout within about 10 minutes of messing with it.
    Read about (and obtain) RelativeLayout at:
    http://www.onjava.com/pub/a/onjava/2002/09/18/relativelayout.html
    and
    http://www.onjava.com/pub/a/onjava/2002/11/27/layout2.html
    Michael Billesbach

  • Book suggestion for GUI

    Hello!
    I would like to purchase a good book that covers how to build the GUI for a program.
    i am specifically interested in the GUI code and the book shall cover GUI from the very basic to the little more advance stuff, with lots of example code in it.
    There are so many books, what book /books do you suggest that I purchase?
    Regards
    Martin
    Edited by: onslow77 on Dec 2, 2009 6:46 PM
    Edited by: onslow77 on Dec 2, 2009 6:47 PM

    Best book for Swing that I've seen so far is [The online Java Tutorial]Yes, big yes.
    One note though: I'm a bit suspicious against the "Learning Swing with the NetBeans IDE" tone the tutorial recently took, but I'm not sure of your objective:
    - If you want to learn Swing, the IDE might get in the way (the generated code has acceptable quality, but Netbeans prevents you to edit it directly). If this is your objective, I'd recommend to follow the tutorial (a very good resource, indeed), but to code things manually (the tutorial provides downloadable and copy-pastable examples). One area where NetBeans' visual design helps is experimenting with layout managers: it's easy to right-clik in the GUI builder and see the effect of the changes.
    - now if you want to quickly set up a GUI for an app with limited investment in learning Swing, I find NetBeans' GUI builder quite handy. AFAIC, I use a duo of Eclipse/NetBeans, depending on the task (taking care not to overwrite NetBeans's protected sections when I edit throug hEclipse).
    - One colleague that used to work with VB tools once mentioned that NB was far late compared to the tools he used to work with, but I suspect what he was referring to were binding widgets to business logic results (reading DB tables, etc..;). NetBeans now addresses these areas too, although I don't use it for that.
    Good luck with Swing.
    J.

  • Documentation on SWING

    Hi,
    who can recommend a good book on swing or give me some URL to download usefull and complete documentation?
    Thank you all
    Anja

    I'm sure there are several good books but while you are waiting for someone else to recommend one, start here:
    http://web2.java.sun.com/docs/books/tutorial/

  • Best setup for a swing application

    Hello,
    I have developed an Swing application for a EPOS machine.
    The machine has around 512 ram.
    What's the best setup for me in terms of performance, for example, which JVM to use etc.....
    Cheers
    Bobby

    bsbiran wrote:
    Hi,
    Well the app require alot of images and I parts of it do run 'slow'
    ...I'm currently going through a book about Swing and read that many times the "slowness" of a Swing-application can be credited to the programmer for not using the API efficiently/correctly (letting the app repaint too much, or repainting large parts that don't need repainting at all, to name just two things). So, I don't know how much of a Swing-guru you are, but it might be better to read a few decent Swing tutorials or pick up a good Swing book.

  • How can I select multiple nodes by standard

    I want to ask how can I modify this example code to enable multiple selection, say if I select node1, system out display node1, then ctr+node2 selection. system out display node1&node2.
    The code below, only display node1, then when I do ctr+node2 selection, system out still display node1.
    I am quite new to JTree, so, please if there is anyone can give a solution?
    Thanks
    * A 1.4 application that requires the following additional files:
    *   TreeDemoHelp.html
    *    arnold.html
    *    bloch.html
    *    chan.html
    *    jls.html
    *    swingtutorial.html
    *    tutorial.html
    *    tutorialcont.html
    *    vm.html
    import javax.swing.JEditorPane;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JSplitPane;
    import javax.swing.UIManager;
    import javax.swing.JTree;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.tree.TreeSelectionModel;
    import javax.swing.event.TreeSelectionEvent;
    import javax.swing.event.TreeSelectionListener;
    import java.net.URL;
    import java.io.IOException;
    import java.awt.Dimension;
    import java.awt.GridLayout;
    public class TreeDemo extends JPanel
                          implements TreeSelectionListener {
        private JEditorPane htmlPane;
        private JTree tree;
        private URL helpURL;
        private static boolean DEBUG = false;
        //Optionally play with line styles.  Possible values are
    //  "Angled" (the default), "Horizontal", and "None".
        private static boolean playWithLineStyle = false;
        private static String lineStyle = "Horizontal";
        //Optionally set the look and feel.
        private static boolean useSystemLookAndFeel = false;
        public TreeDemo() {
            super(new GridLayout(1,0));
            //Create the nodes.
            DefaultMutableTreeNode top =
                new DefaultMutableTreeNode("The Java Series");
            createNodes(top);
            //Create a tree that allows one selection at a time.
            tree = new JTree(top);
            tree.getSelectionModel().setSelectionMode
                    (TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);---->Cause problem, when press Ctr to multiple select, always the first selected node is returned, which is shown in System out
            //Listen for when the selection changes.
            tree.addTreeSelectionListener(this);
            if (playWithLineStyle) {
                System.out.println("line style = " + lineStyle);
                tree.putClientProperty("JTree.lineStyle", lineStyle);
            //Create the scroll pane and add the tree to it.
            JScrollPane treeView = new JScrollPane(tree);
            //Create the HTML viewing pane.
            htmlPane = new JEditorPane();
            htmlPane.setEditable(false);
            initHelp();
            JScrollPane htmlView = new JScrollPane(htmlPane);
            //Add the scroll panes to a split pane.
            JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
            splitPane.setTopComponent(treeView);
            splitPane.setBottomComponent(htmlView);
            Dimension minimumSize = new Dimension(100, 50);
            htmlView.setMinimumSize(minimumSize);
            treeView.setMinimumSize(minimumSize);
            splitPane.setDividerLocation(100); //XXX: ignored in some releases
                                               //of Swing. bug 4101306
            //workaround for bug 4101306:
            //treeView.setPreferredSize(new Dimension(100, 100));
            splitPane.setPreferredSize(new Dimension(500, 300));
            //Add the split pane to this panel.
            add(splitPane);
        /** Required by TreeSelectionListener interface. */
        public void valueChanged(TreeSelectionEvent e) {
            DefaultMutableTreeNode node = (DefaultMutableTreeNode)
                               tree.getLastSelectedPathComponent();
            if (node == null) return;
            Object nodeInfo = node.getUserObject();
            System.out.print("\nMy selection node is"+nodeInfo.toString());
            if (node.isLeaf()) {
                BookInfo book = (BookInfo)nodeInfo;
                displayURL(book.bookURL);
                if (DEBUG) {
                    System.out.print(book.bookURL + ":  \n    ");
            } else {
                displayURL(helpURL);
            if (DEBUG) {
                System.out.println(nodeInfo.toString());
        private class BookInfo {
            public String bookName;
            public URL bookURL;
            public BookInfo(String book, String filename) {
                bookName = book;
                bookURL = TreeDemo.class.getResource(filename);
                if (bookURL == null) {
                    System.err.println("Couldn't find file: "
                                       + filename);
            public String toString() {
                return bookName;
        private void initHelp() {
            String s = "TreeDemoHelp.html";
            helpURL = TreeDemo.class.getResource(s);
            if (helpURL == null) {
                System.err.println("Couldn't open help file: " + s);
            } else if (DEBUG) {
                System.out.println("Help URL is " + helpURL);
            displayURL(helpURL);
        private void displayURL(URL url) {
            try {
                if (url != null) {
                    htmlPane.setPage(url);
                } else { //null url
              htmlPane.setText("File Not Found");
                    if (DEBUG) {
                        System.out.println("Attempted to display a null URL.");
            } catch (IOException e) {
                System.err.println("Attempted to read a bad URL: " + url);
        private void createNodes(DefaultMutableTreeNode top) {
            DefaultMutableTreeNode category = null;
            DefaultMutableTreeNode book = null;
            category = new DefaultMutableTreeNode("Books for Java Programmers");
            top.add(category);
            //original Tutorial
            book = new DefaultMutableTreeNode(new BookInfo
                ("The Java Tutorial: A Short Course on the Basics",
                "tutorial.html"));
            category.add(book);
            //Tutorial Continued
            book = new DefaultMutableTreeNode(new BookInfo
                ("The Java Tutorial Continued: The Rest of the JDK",
                "tutorialcont.html"));
            category.add(book);
            //JFC Swing Tutorial
            book = new DefaultMutableTreeNode(new BookInfo
                ("The JFC Swing Tutorial: A Guide to Constructing GUIs",
                "swingtutorial.html"));
            category.add(book);
            //Bloch
            book = new DefaultMutableTreeNode(new BookInfo
                ("Effective Java Programming Language Guide",
              "bloch.html"));
            category.add(book);
            //Arnold/Gosling
            book = new DefaultMutableTreeNode(new BookInfo
                ("The Java Programming Language", "arnold.html"));
            category.add(book);
            //Chan
            book = new DefaultMutableTreeNode(new BookInfo
                ("The Java Developers Almanac",
                 "chan.html"));
            category.add(book);
            category = new DefaultMutableTreeNode("Books for Java Implementers");
            top.add(category);
            //VM
            book = new DefaultMutableTreeNode(new BookInfo
                ("The Java Virtual Machine Specification",
                 "vm.html"));
            category.add(book);
            //Language Spec
            book = new DefaultMutableTreeNode(new BookInfo
                ("The Java Language Specification",
                 "jls.html"));
            category.add(book);
         * Create the GUI and show it.  For thread safety,
         * this method should be invoked from the
         * event-dispatching thread.
        private static void createAndShowGUI() {
            if (useSystemLookAndFeel) {
                try {
                    UIManager.setLookAndFeel(
                        UIManager.getSystemLookAndFeelClassName());
                } catch (Exception e) {
                    System.err.println("Couldn't use system look and feel.");
            //Make sure we have nice window decorations.
            JFrame.setDefaultLookAndFeelDecorated(true);
            //Create and set up the window.
            JFrame frame = new JFrame("TreeDemo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Create and set up the content pane.
            TreeDemo newContentPane = new TreeDemo();
            newContentPane.setOpaque(true); //content panes must be opaque
            frame.setContentPane(newContentPane);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args) {
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
    }

    you can use the method getSelectionPaths() in the class JTree. It will return an array of all the TreePaths you have selected. Then on each of the TreePath you got use the method getLastPathComponent() to get the nodes which you have selected.
    Hope this solves your problem.

  • Why does a JButton automatically have a mouse listener registered with it?

    If I instantiate a JButton, I find there's a mouse listener already registered (see code below). Does anyone know why?
    Looking at the source code for JButton, I can't see how this is. If a create a dummy subclass of AbstractButton (of which JButton is a direct subclass) and instantiate that, it has no mouse listeners, and likewize with Button. So what is it about JButton?
    The reason I ask is that I've seen in a book on swing that you must call enableEvents(AWTEvent.MOUSE_EVENT_MASK) on a JButton if you want processMouseEvent to get executed. But it actually gets executed even if enableEvents hasn't been called, and the only reason for this is surely that there is a mouse listener registered, which there is, but why?
    Might the reason be that JButton extends Accessible?
    Code:
    JButton jb = new JButton("Dummy");
    MouseListener[] mls = (MouseListener[])(jb.getListeners(MouseListener.class));
    JOptionPane.showMessageDialog(this, (new Integer(mls.length)).toString(), "Number of Mouse Listeners", JOptionPane.INFORMATION_MESSAGE);

    Hello,
    That listener is installed by the JButton's UI. You might want to have a look at the source code of BasicButtonUI and BasicButtonListener to understand what they are used for. For example, mousePressed in BasicButtonListener is used to call setArmed on the JButton.
    My best advice is for you not to worry about this at all.

  • Multiple Lines in a Jtable Cell

    I am trying to place multiple lines in a single cell of Jtable
    The text Of the cell comes from the database.I am trying to do it using a JLabel .If anyone can help me please do so
    thanks
    kishore
    [email protected]

    It can be done but it is quite a lot of work. Basically you have to produce your own cell renderer and use that instead. A good book on swing will tell you how to do it.

  • How can we give the option to edit the cell value of a table to user

    i have a Jtable which shows the entered values of all the expenses daily.Before saving them i want to provide an option to user for editing.How this is possible.
    I went through the TableCellEditor interface .I think it needs to be implemented some code there.
    help me out in implementing those methods.

    Might I suggest reading the JTable tutorial? And/Or perhaps purchasing a book on swing?

  • How to put JScrolPAne in a JText Area

    JTextArea TArea=new JTextArea("",20,20);
    JScrollPane SPane= new JScrollPane(TArea);
    c.add(TArea,0);
    how??

    You could try something like:
    http://www.beginner-java-tutorial.com/java-swing-tutorial.html
    but I still think the one Sun has is the best. I did that years ago (1.2) and from there have just kept up with the changes and forums. Swing is complex, from the basic understanding of not blocking the event dispatch thread to understanding gridbaglayouts, you might want to try and find a really good book on swing (I used to have one a few years ago... don't ask me what it was...)

Maybe you are looking for

  • Can not install powerdvd10 on B540 which was uninstall accidently

    Can not install powerdvd10 on B540 which was uninstall accidently. When I try to install from downloaded exe. file  there was error message "This software can only be installed on a lenovo system"

  • Please provide link to Oracle 10.2.0.2 installation on HP-UX 11.23

    Hi , I are trying to install Solman 4.0  on Hp-UX 11.23/ Itanium 64 with Oracle 10.2.0.2 as the backend. I am unable to find  any Installtion guide  for Oracle 10.2.0.2 installation at  SAP service market place, however I am able to find UPGRADE Guid

  • JSF Link PArameter get null

    I have a page with link http://localhost:8080/Test/Page.faces?id=asdasdasd The page got 2 text field and one button, after user key in the details and click submit, it works well when you first time click the submit button, the id will return me the

  • Swing table and JScrollPane

    I am using JTable with JScrollPane. JScrollPane is set with the scroll bar policy set to AS-NEEDED. But still when my table columns go beyond the table or View Port Horizontal Scroll bar of the ScrollPane does not appear. I also tried the ALWAYS poli

  • I have an iMac G5 PowerPC running 10.4.11.  How can I get Hotmail to work properly?

    I understand that 10.4.11 is the highest version of software I can use on my iMac, but when I log in to Hotmail it asks me to upgrade my version of Safari (I'm on 4.1.3 (4533.19.4)) otherwise it continues to "mobile experience".  This is usable, but