Whats wrong!

I am new to the whole programming and just need a little help with the gui!

I want that this program will cange value in the console while changing the slide:

import javax.swing.JFrame;

import javax.swing.JPanel;

import java.awt.BorderLayout;

import java.awt.Dimension;

import java.awt.Rectangle;

import java.awt.GridBagLayout;

import javax.swing.JLabel;

import javax.swing.JSlider;

import java.awt.event.KeyEvent;

import java.awt.Font;

import java.awt.ComponentOrientation;

publicclass gui_slide{

private JFrame jFrameSlide =null;// @jve:decl-index=0:visual-constraint="23,21"

private JPanel jContentPaneSlide =null;

private JPanel jPanelFreq =null;

private JLabel jLabel =null;

private JSlider jSliderFreq =null;

/**

* This method initializes jFrameSlide

*

* @return javax.swing.JFrame

*/

private JFrame getJFrameSlide(){

if (jFrameSlide ==null){

jFrameSlide =new JFrame();

jFrameSlide.setSize(new Dimension(600, 350));

jFrameSlide.setTitle("Frequence");

jFrameSlide.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

jFrameSlide.setFont(new Font("Dialog", Font.PLAIN, 12));

jFrameSlide.setVisible(true);

jFrameSlide.setContentPane(getJContentPaneSlide());

}

return jFrameSlide;

}

/**

* This method initializes jContentPaneSlide

*

* @return javax.swing.JPanel

*/

private JPanel getJContentPaneSlide(){

if (jContentPaneSlide ==null){

jContentPaneSlide =new JPanel();

jContentPaneSlide.setLayout(null);

jContentPaneSlide.add(getJPanelFreq(),null);

}

return jContentPaneSlide;

}

/**

* This method initializes jPanelFreq

*

* @return javax.swing.JPanel

*/

private JPanel getJPanelFreq(){

if (jPanelFreq ==null){

jLabel =new JLabel();

jLabel.setBounds(new Rectangle(56, 35, 61, 30));

jLabel.setDisplayedMnemonic(KeyEvent.VK_UNDEFINED);

jLabel.setText("Frequence");

jPanelFreq =new JPanel();

jPanelFreq.setLayout(null);

jPanelFreq.setBounds(new Rectangle(6, 4, 581, 307));

jPanelFreq.add(jLabel,null);

jPanelFreq.add(getJSliderFreq(),null);

}

return jPanelFreq;

}

/**

* This method initializes jSliderFreq

*

* @return javax.swing.JSlider

*/

private JSlider getJSliderFreq(){

if (jSliderFreq ==null){

jSliderFreq =new JSlider();

jSliderFreq.setBounds(new Rectangle(56, 76, 61, 179));

jSliderFreq.setPaintTicks(true);

jSliderFreq.setMaximum(10);

jSliderFreq.setMajorTickSpacing(2);

jSliderFreq.setMinorTickSpacing(1);

jSliderFreq.setSnapToTicks(true);

jSliderFreq.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);

jSliderFreq.setOrientation(JSlider.VERTICAL);

jSliderFreq.addChangeListener(new javax.swing.event.ChangeListener(){

publicvoid stateChanged(javax.swing.event.ChangeEvent e){

System.out.println("Hello");// TODO Auto-generated Event stub stateChanged()

}

});

}

return jSliderFreq;

}

}

[6161 byte] By [pageolava] at [2007-11-26 19:57:42]
# 1
> I am new to the whole programming and just need a> little help with the gui!> I want that this program will cange value in the> console while changing the slide:Change it to what? What do you mean by change?Kaj
kajbja at 2007-7-9 22:52:40 > top of Java-index,Java Essentials,New To Java...
# 2

What I mean is that I want a slide. This slide will print a println, in this example "Hello" for each time i change the value of the slide?

If anyone can help me with printing the value of the slide. For example this slide have 10 position, when the slide is in the 1st position it will print "1" and in the second it will print "2" and so on..

Anyone can help, please...

Would be grateful!

pageolava at 2007-7-9 22:52:41 > top of Java-index,Java Essentials,New To Java...
# 3
Print jSliderFreq.getValue() Kaj
kajbja at 2007-7-9 22:52:41 > top of Java-index,Java Essentials,New To Java...
# 4
Why does this prints in the console? and what do I have to do and change it?IWAV0048I Java Bean gui_slide started with null constructor
pageolava at 2007-7-9 22:52:41 > top of Java-index,Java Essentials,New To Java...