Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 19 of 19

Thread: I have a problem with slider in java swing

  1. #1
    Member
    Join Date
    Oct 2013
    Location
    Cyprus
    Posts
    35
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default I have a problem with slider in java swing

    Hello,
    I have a problem with slider which i want to create jlabels in a panel by sliding the slider and get the value but the jlabel doesn't show in jpanel.below is the code :

     JPanel PanelBoxes;
        JPanel panel;
        JLabel c; 
        public static void main(String[] args){
            DividePanel div = new DividePanel();
            div.go();
        }
     
        public void go(){
     
            JFrame frame = new JFrame("My Frame");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     
            JSlider slide = new JSlider();
            slide.addChangeListener(new SlidersListener());
     
     
            JSlider slidev = new JSlider(JSlider.VERTICAL);
            //slidev.addChangeListener(new SlideListener());
     
            PanelBoxes  = new JPanel();
            PanelBoxes.setPreferredSize(new Dimension(200,150));
     
            panel = new JPanel();
            panel.setBorder(BorderFactory.createLineBorder(Color.RED,2,false));
            panel.add(BorderLayout.CENTER,PanelBoxes);
     
            frame.getContentPane().add(BorderLayout.NORTH,slide);
            frame.getContentPane().add(BorderLayout.WEST,slidev);
            frame.getContentPane().add(BorderLayout.EAST,new JPanel());
            frame.getContentPane().add(BorderLayout.SOUTH,new JPanel());
            frame.getContentPane().add(BorderLayout.CENTER,panel);
     
            frame.setSize(400, 300);
            frame.setVisible(true);
        }
     
        public class SlidersListener implements ChangeListener{
     
            @Override
            public void stateChanged(ChangeEvent e) {
                JSlider source = (JSlider) e.getSource();
     
                if(!source.getValueIsAdjusting()){
                    int count=source.getValue();
                    JOptionPane.showConfirmDialog(source,count);
                    for(int i=0; i<2; i++){
                      c = new JLabel("asdasd");
                      c.setPreferredSize(new Dimension(100,30));
                      c.setBackground(Color.red);
                      c.setOpaque(true);
                      PanelBoxes.add(c);
                    }
     
               }
            }

    Thanks in advance guys


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: I have a problem with slider in java swing

    Adding components to a container "on the fly" isn't the recommended approach, but if you're set on it, then validate() the container after adding.

  3. #3
    Member
    Join Date
    Oct 2013
    Location
    Cyprus
    Posts
    35
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: I have a problem with slider in java swing

    Quote Originally Posted by GregBrannon View Post
    Adding components to a container "on the fly" isn't the recommended approach, but if you're set on it, then validate() the container after adding.
    Can you explain me please how to do it with the right way?
    I noticed that when i tried to resize the jframe the components appeared.

  4. #4
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: I have a problem with slider in java swing

    Can you explain better what the program is supposed to do? Right now, it adds 2 labels to panelBoxes each time a slider changes. I'm assuming that's a building block to where you'd like to go, so please explain the program's ultimate functionality. What is supposed to happen in response to changes in the the 2 slider values?

  5. #5
    Member
    Join Date
    Feb 2014
    Posts
    180
    Thanks
    0
    Thanked 48 Times in 45 Posts

    Default Re: I have a problem with slider in java swing

    This looks like a work-in-progress code. The vertical slider doesn't do anything just yet as

    //slidev.addChangeListener(new SlideListener());

    is commented out.

    Validate-ing the container is just that - a method call on the container on which the JLabels are being added. E.g.,

    					c.setOpaque(true);
    					PanelBoxes.add(c);
    					PanelBoxes.revalidate();

    Take a look at the API docs on the revalidate() method in JPanel (inherited from JComponent). Hth!

  6. #6
    Member
    Join Date
    Oct 2013
    Location
    Cyprus
    Posts
    35
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: I have a problem with slider in java swing

    Quote Originally Posted by GregBrannon View Post
    Can you explain better what the program is supposed to do? Right now, it adds 2 labels to panelBoxes each time a slider changes. I'm assuming that's a building block to where you'd like to go, so please explain the program's ultimate functionality. What is supposed to happen in response to changes in the the 2 slider values?
    I want to divide equally a jpanel by creating random sub panel with the slider value. something like this Equivalent Fractions

    public class DividePanel {
     
        JPanel PanelBoxes;
     
        public static void main(String[] args){
            DividePanel div = new DividePanel();
            div.go();
        }
     
        public void go(){
     
            JFrame frame = new JFrame("My Frame");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     
            JSlider slide = new JSlider(1,4);
            slide.setValue(1);
            slide.setMajorTickSpacing(1);
            slide.setPaintTicks(true);
            slide.setPaintLabels(true);
            slide.setSnapToTicks(true);
            slide.addChangeListener(new SlidersListener());
     
            JSlider slidev = new JSlider(JSlider.VERTICAL);
            slidev.addChangeListener(new VerticalSliderListener());
     
            PanelBoxes = new JPanel();
            PanelBoxes.setPreferredSize(new Dimension(400,400));
            PanelBoxes.setBorder(BorderFactory.createLineBorder(Color.RED,2,false));
     
            frame.getContentPane().add(BorderLayout.NORTH,slide);
            frame.getContentPane().add(BorderLayout.WEST,slidev);
            frame.getContentPane().add(BorderLayout.EAST,new JPanel());
            frame.getContentPane().add(BorderLayout.SOUTH,new JPanel());
            frame.getContentPane().add(BorderLayout.CENTER,PanelBoxes);
            frame.validate();
     
            frame.setSize(500, 480);
            frame.setVisible(true);
        }
     
        public class SlidersListener implements ChangeListener{
     
            @Override
            public void stateChanged(ChangeEvent e) {
                PanelBoxes.removeAll();
                JSlider source = (JSlider) e.getSource();
     
                if(!source.getValueIsAdjusting()){
     
                    int count=source.getValue();
                      //JOptionPane.showConfirmDialog(source,count);
                     for(int i=1; i<=count; i++){
                      JPanel b = new JPanel();
                      b.setPreferredSize(new Dimension(400,360/count));
                      b.setBackground(new Color((int)(Math.random()*256),(int)(Math.random()*256),(int)(Math.random()*256)));
                      b.setBorder(BorderFactory.createLineBorder(Color.RED, 1, false));
                      PanelBoxes.add(b);
                      PanelBoxes.validate();
                     }
                   }
     
            }//end of state change 
        }//end of listener class

    But again the window is not equally divided and i have minor spaces between jpanels.I want to make it better

  7. #7
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: I have a problem with slider in java swing

    I don't think you're really wanting to do anything 'randomly,' and adding JLabels to a component is not the same thing as dividing a component's area into grids.

    Are you saying the slider along the left side indicates the number of rows the panel should have and the slider along the top indicates the number of columns? This effect can be accomplished rather simply by drawing equally spaced horizontal lines for the rows and vertical lines for the columns directly on the component's graphics object. You could check out the Java Tutorial Custom Painting to see how this is done.

  8. #8
    Member
    Join Date
    Oct 2013
    Location
    Cyprus
    Posts
    35
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: I have a problem with slider in java swing

    Quote Originally Posted by GregBrannon View Post
    I don't think you're really wanting to do anything 'randomly,' and adding JLabels to a component is not the same thing as dividing a component's area into grids.

    Are you saying the slider along the left side indicates the number of rows the panel should have and the slider along the top indicates the number of columns? This effect can be accomplished rather simply by drawing equally spaced horizontal lines for the rows and vertical lines for the columns directly on the component's graphics object. You could check out the Java Tutorial Custom Painting to see how this is done.
    Yes that i want to do! Can you suggest me links that can help me with that?

     MyDrawPanel panel;
        JFrame frame;
        int x = 0;
        int counter = 0;
        int stepping = 0;
        JSlider hslider;
        public static void main(String[] args){
            DividePanel div = new DividePanel();
            div.go();
        }
     
        public void go(){
     
            frame = new JFrame("My Frame");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     
            hslider = new JSlider(1,4);
            hslider.setValue(1);
            hslider.setMajorTickSpacing(1);
            hslider.setPaintLabels(true);
            hslider.setPaintTicks(true);
            hslider.addChangeListener(new HsliderListener());
     
            panel = new MyDrawPanel();
            panel.setBorder(BorderFactory.createLineBorder(Color.BLUE,2,false));
     
            frame.getContentPane().add(BorderLayout.NORTH,hslider);
            frame.getContentPane().add(BorderLayout.CENTER,panel); 
     
            frame.setSize(400, 400);
            frame.setVisible(true);
     
        }
     
        public class MyDrawPanel extends JPanel{
     
            @Override
            public void paintComponent(Graphics g){
             g.setColor(Color.WHITE);
             g.fillRect(0, 0, this.getWidth(), this.getHeight());
     
             for(int i=1; i<counter; i++){
                stepping=400/counter;
                g.setColor(Color.BLUE);
                g.drawLine(0, x+stepping, this.getWidth(), x+stepping);
             }
     
            }
        }
          public class HsliderListener implements ChangeListener{
     
            @Override
            public void stateChanged(ChangeEvent e) {
                counter = hslider.getValue();
     
                panel.repaint();
            }
     
        }

    I want to draw lines in jpanel so to be divided equally.but my code doesn't work correctly.When i drag the slider the slider is repaint in jpanel how is this possible???
    Please can anyone help me

  9. #9
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: I have a problem with slider in java swing


  10. #10
    Member
    Join Date
    Oct 2013
    Location
    Cyprus
    Posts
    35
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: I have a problem with slider in java swing

    Quote Originally Posted by GregBrannon View Post
    I have read the lessons but my problem remains can anyone help me with my code?My purpose is to divide a jpanel when i slide the slider.For example when i slide to 2 then divide the jpanel with a line to two.Helppppppp !!!

  11. #11
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: I have a problem with slider in java swing

    It's not clear how you applied what you 'learned' in the lesson to your project. Can you clarify?

  12. #12
    Member
    Join Date
    Oct 2013
    Location
    Cyprus
    Posts
    35
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: I have a problem with slider in java swing

    Quote Originally Posted by GregBrannon View Post
    It's not clear how you applied what you 'learned' in the lesson to your project. Can you clarify?
    I have created a jframe, jpanel and jslider then i have add change listener on jslider so on change i save the value in variable and i have a for loop to draw n lines in jpanel.I have created a separate inner class which extends jpanel and i have method paintComponent which draw lines according to slider values on change.My problem is that i want to draw lines in jpanel so to be equally separated according to the values of jslider.If i am not clear,i can post the code.
    Thanks mate

  13. #13
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: I have a problem with slider in java swing

    There is some simple math involved:

    Read the row/column sliders
    Determine the size of the drawing area
    Divide the appropriate dimension of the drawing area into an equal number of rows/columns as specified by the sliders
    Draw the row/column lines at the necessary intervals to show the desired number of rows/columns

  14. #14
    Member
    Join Date
    Oct 2013
    Location
    Cyprus
    Posts
    35
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: I have a problem with slider in java swing

    Quote Originally Posted by GregBrannon View Post
    There is some simple math involved:

    Read the row/column sliders
    Determine the size of the drawing area
    Divide the appropriate dimension of the drawing area into an equal number of rows/columns as specified by the sliders
    Draw the row/column lines at the necessary intervals to show the desired number of rows/columns
    I divide the size of jpanel with the slider value, so if the user selects 2(counter) then stepping=400/counter and then with a for loop i want to draw lines each time +stepping

    paint component(){
    for(int i=0;i<counter;i++){
    drawline(0, x+stepping,this.getwidth, x+stepping);
    }
    }
    But the line does not appear.Can you help me with the code?

  15. #15
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: I have a problem with slider in java swing

    Are you meaning to use the paintComponent() method? Please properly post actual code, copied and pasted. Guessing at what you meant to post when typos are involved is just wasting time.

    Also, verify the for loop actually does something. What is counter? Consider that for 2 rows, only one line is drawn. I think your current for loop would draw 2 lines for 2 rows (or columns).

  16. #16
    Member
    Join Date
    Oct 2013
    Location
    Cyprus
    Posts
    35
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: I have a problem with slider in java swing

    Quote Originally Posted by GregBrannon View Post
    Are you meaning to use the paintComponent() method? Please properly post actual code, copied and pasted. Guessing at what you meant to post when typos are involved is just wasting time.

    Also, verify the for loop actually does something. What is counter? Consider that for 2 rows, only one line is drawn. I think your current for loop would draw 2 lines for 2 rows (or columns).
    My task is very simple.Look Equivalent Fractions.I want to do that using java language.When i drag the slider to paint rows(or columns) in the white box.
    First, i am not sure if my though is correct or not.When i drag the slider i get that value and save it in counter variable.Then i divide it with jpanel size e.g
    400/counter if the counter=2 then 400/2=200 so draw a line g.drawline(0, 200,this.getwidth,200).So my jpanel will be divided to 2.

    Below is my code and i am not sure if it's correct.

    MyDrawPanel panel;
        JFrame frame;
        int counter = 0, x=0;
        int stepping = 0;
        JSlider hslider;
     
        public static void main(String[] args){
            DividePanel div = new DividePanel();
            div.go();
        }
     
        public void go(){
     
            frame = new JFrame("My Frame");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     
            hslider = new JSlider(JSlider.HORIZONTAL,1,4,1);
            //hslider.setValue(1);
            hslider.setMajorTickSpacing(1);
            hslider.setPaintLabels(true);
            hslider.setPaintTicks(true);
            hslider.addChangeListener(new HsliderListener());
     
            frame.getContentPane().add(BorderLayout.SOUTH,hslider);
            frame.getContentPane().add(BorderLayout.CENTER,new MyDrawPanel()); 
     
            frame.setSize(400, 400);
            frame.setVisible(true);
     
        }
     
        public class MyDrawPanel extends JPanel{
     
            public MyDrawPanel(){
                setBorder(BorderFactory.createLineBorder(Color.BLUE,2, false));
            }
     
            @Override
            public Dimension getPreferredSize(){
                return new Dimension(400,400);
     
            }
            @Override
            public void paintComponent(Graphics g){
                super.paintComponent(g);
                 g.setColor(Color.WHITE);
                 g.fillRect(0, 0, this.getWidth(), this.getHeight());
     
                 g.setColor(Color.BLUE);
                 for(int i=0; i<counter; i++){
                  x+=stepping;   
                  g.drawLine(0, x, this.getWidth(), x);
                 }
     
            }
        }
          public class HsliderListener implements ChangeListener{
     
            @Override
            public void stateChanged(ChangeEvent e) {
                counter = hslider.getValue();
                stepping = 400/counter;
                //JOptionPane.showConfirmDialog(rootPane, stepping);   
            }
        }

    My task is to do the same as you see in the page i posted but with jframe and swing components.Sorry for wasting your time but i have spent hours with no solution.Tell me if i am not clear!!!

  17. #17
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: I have a problem with slider in java swing

    You made good progress and were almost there. You're getting frustrated. I made some minor changes with comments plus a few others I can't help making. (It's an OCD thing.) Let me know if you have any questions.
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
     
    public class DividePanel
    {
        MyDrawPanel panel;
        JFrame frame;
        int counter = 0, x=0;
        int stepping = 0;
        JSlider hslider;
     
        public static void main(String[] args)
        {
            DividePanel div = new DividePanel();
            div.go();
        }
     
        public void go()
        {
            frame = new JFrame("My Frame");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     
            hslider = new JSlider(JSlider.HORIZONTAL,1,4,1);
            //hslider.setValue(1);
            hslider.setMajorTickSpacing(1);
            hslider.setPaintLabels(true);
            hslider.setPaintTicks(true);
            hslider.addChangeListener(new HsliderListener());
     
            // create an instance of MyDrawPanel
            panel = new MyDrawPanel();
            frame.getContentPane().add(BorderLayout.SOUTH,hslider);
            // add the panel to the JFrame
            frame.getContentPane().add(BorderLayout.CENTER, panel ); 
     
            frame.setSize(400, 400);
            frame.setVisible(true);
     
        } // end method go()
     
        public class MyDrawPanel extends JPanel
        {
            // instance variables
            int columns;
     
            // default constructor
            public MyDrawPanel()
            {
                // initialize instance variables
                columns = 1;
                setBorder(BorderFactory.createLineBorder(Color.BLUE,2, false));
            }
     
            @Override
            public Dimension getPreferredSize(){
                return new Dimension(400,400);
            }
     
            @Override
            public void paintComponent(Graphics g)
            {
                super.paintComponent(g);
                g.setColor(Color.WHITE);
                g.fillRect(0, 0, this.getWidth(), this.getHeight());
     
                g.setColor(Color.BLUE);
     
                // draw equally spaced vertical lines for the number of columns
                int lines = columns - 1;
                int spacing = 0;
     
                if ( lines > 0 )
                {
                    spacing = getWidth() / columns;
     
                    // draw the lines
                    for ( int i = 0 ; i <= lines ; i++ )
                    {
                        g.drawLine( ( i * spacing ), 0, ( i * spacing ), getHeight() );
                    }
                }
     
                // draw equally spaced horizontal lines for the number of rows
     
     
                // I'm not sure what this does
                for(int i=0; i<counter; i++)
                {
                    x+=stepping;   
                    g.drawLine(0, x, this.getWidth(), x);
                }
     
            }
     
            // to set the number of columns
            public void setColumns( int columns )
            {
                this.columns = columns;
            }
     
        } // end class MyDrawPanel
     
        public class HsliderListener implements ChangeListener
        {
            @Override
            public void stateChanged(ChangeEvent e)
            {
                counter = hslider.getValue();
                stepping = 400/counter;
     
                // use the panel instance to set the number of columns and
                // rows that should be drawn, then repaint
                panel.setColumns( counter );
                panel.repaint();
            }
     
        } // end class HsliderListener
     
    } // end class DividePanel

  18. #18
    Member
    Join Date
    Oct 2013
    Location
    Cyprus
    Posts
    35
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: I have a problem with slider in java swing

    Quote Originally Posted by GregBrannon View Post
    You made good progress and were almost there. You're getting frustrated. I made some minor changes with comments plus a few others I can't help making. (It's an OCD thing.) Let me know if you have any questions.
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
     
    public class DividePanel
    {
        MyDrawPanel panel;
        JFrame frame;
        int counter = 0, x=0;
        int stepping = 0;
        JSlider hslider;
     
        public static void main(String[] args)
        {
            DividePanel div = new DividePanel();
            div.go();
        }
     
        public void go()
        {
            frame = new JFrame("My Frame");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     
            hslider = new JSlider(JSlider.HORIZONTAL,1,4,1);
            //hslider.setValue(1);
            hslider.setMajorTickSpacing(1);
            hslider.setPaintLabels(true);
            hslider.setPaintTicks(true);
            hslider.addChangeListener(new HsliderListener());
     
            // create an instance of MyDrawPanel
            panel = new MyDrawPanel();
            frame.getContentPane().add(BorderLayout.SOUTH,hslider);
            // add the panel to the JFrame
            frame.getContentPane().add(BorderLayout.CENTER, panel ); 
     
            frame.setSize(400, 400);
            frame.setVisible(true);
     
        } // end method go()
     
        public class MyDrawPanel extends JPanel
        {
            // instance variables
            int columns;
     
            // default constructor
            public MyDrawPanel()
            {
                // initialize instance variables
                columns = 1;
                setBorder(BorderFactory.createLineBorder(Color.BLUE,2, false));
            }
     
            @Override
            public Dimension getPreferredSize(){
                return new Dimension(400,400);
            }
     
            @Override
            public void paintComponent(Graphics g)
            {
                super.paintComponent(g);
                g.setColor(Color.WHITE);
                g.fillRect(0, 0, this.getWidth(), this.getHeight());
     
                g.setColor(Color.BLUE);
     
                // draw equally spaced vertical lines for the number of columns
                int lines = columns - 1;
                int spacing = 0;
     
                if ( lines > 0 )
                {
                    spacing = getWidth() / columns;
     
                    // draw the lines
                    for ( int i = 0 ; i <= lines ; i++ )
                    {
                        g.drawLine( ( i * spacing ), 0, ( i * spacing ), getHeight() );
                    }
                }
     
                // draw equally spaced horizontal lines for the number of rows
     
     
                // I'm not sure what this does
                for(int i=0; i<counter; i++)
                {
                    x+=stepping;   
                    g.drawLine(0, x, this.getWidth(), x);
                }
     
            }
     
            // to set the number of columns
            public void setColumns( int columns )
            {
                this.columns = columns;
            }
     
        } // end class MyDrawPanel
     
        public class HsliderListener implements ChangeListener
        {
            @Override
            public void stateChanged(ChangeEvent e)
            {
                counter = hslider.getValue();
                stepping = 400/counter;
     
                // use the panel instance to set the number of columns and
                // rows that should be drawn, then repaint
                panel.setColumns( counter );
                panel.repaint();
            }
     
        } // end class HsliderListener
     
    } // end class DividePanel
    WOW Thanks so much , i was very close.How i will become so good as you? You read many books , hours of programming or it's a secret
    How i will give you a thumps up for the help?

  19. #19
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: I have a problem with slider in java swing

    There's no secret sauce or handshake, Vulcan mind meld, or shortcut to acquiring the skills and confidence in using them. It's all practice, practice, and more practice. Reading the books doesn't help without applying what is read at a very high ratio of application to reading.

    Keep coding, and you'll get there. No one can stop you. It's entirely up to you.

  20. The Following User Says Thank You to GregBrannon For This Useful Post:

    mariosarmy (February 26th, 2014)

Similar Threads

  1. Using a Slider value with another class
    By jason3460 in forum AWT / Java Swing
    Replies: 10
    Last Post: December 2nd, 2013, 06:49 PM
  2. Java slider blocking my homepage
    By TheUpcoming in forum Other Programming Languages
    Replies: 1
    Last Post: June 5th, 2012, 07:48 AM
  3. updating SWT Slider from separate java class
    By ppmckee in forum AWT / Java Swing
    Replies: 0
    Last Post: April 14th, 2011, 03:23 PM
  4. Problem with java swing JButton in Netbeans IDE
    By vrp in forum What's Wrong With My Code?
    Replies: 2
    Last Post: January 12th, 2011, 11:38 PM
  5. [SOLVED] Java Swing problem?
    By nasser in forum AWT / Java Swing
    Replies: 2
    Last Post: July 3rd, 2010, 12:34 PM

Tags for this Thread