HOW TO CREAT SLIDERS?(PLEASE HELP)
Hey1
i have to craet three sliders (in three differet panels)so that when i get the current date the three sliders are set in a way that Year slider matches the current year,the monthe slider matchs the current month and the date slider matches the current date.
If some body could give me a start by telling me how to make a slider and how to devide it (like for months i have to devide it in to 12 devisions),i am sure i will be able to do the rest of it............(unfortunately i don't have a book either so please help me ,,,,)
THANKS A LOT!
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
import java.text.SimpleDateFormat;
public class Grid extends JFrame /*implements ActionListener*/
{
private JPanel date_panel,year_panel, month_panel,day_panel;
private String time=new String("");
private Date date=new Date();
public Grid() {
time=time + new Date().toString();
SimpleDateFormat formatter = new SimpleDateFormat("E, MMMM d, yyyy") ;
time = formatter.format(date) ;
date_panel=new JPanel();
year_panel=new JPanel();
month_panel=new JPanel();
day_panel=new JPanel();
date_panel.setLayout(new FlowLayout());
date_panel.add(new JLabel(time));
year_panel.setLayout(new FlowLayout());
month_panel.setLayout(new FlowLayout());
day_panel.setLayout(new FlowLayout());
Container contentPane = getContentPane();
contentPane.setLayout(new GridLayout(1,4));
contentPane.add(date_panel);
//contentPane.add(year_panel);
//contentPane.add(month_panel);
//contentPane.add(day_panel);
}
public static void main(String args[]) {
Grid gw = new Grid();
gw.setTitle("Date Slider");
gw.setSize(400,200);
gw.setVisible(true);
}
}

