@SuppressWarnings("rawtypes")
	public static void settingsDialog(){
		
		final JFrame f = new JFrame();
		JTabbedPane mainPane = new JTabbedPane();
		JPanel buttonPanel = new JPanel();
		CBeanRolloverButton ok = CBeanRolloverButton.GetOkButton("OK","Save the settings");
		CBeanRolloverButton cancel = CBeanRolloverButton.GetCancelButton("Cancel", "Cancel the settings");
		
		FlowLayout forbuttons = new FlowLayout();
		forbuttons.setAlignment(FlowLayout.RIGHT);
		
		buttonPanel.setLayout(forbuttons);
		buttonPanel.add(ok);
		buttonPanel.add(cancel);
		buttonPanel.setPreferredSize(new Dimension(200 , 200));
		////////////////////////////////first tab
		JPanel panel = new JPanel();
		JPanel closePanel = new JPanel();
		JPanel dateFormatPanel = new JPanel();
		JPanel clockPanel  = new JPanel();
		
		JLabel dClose = new JLabel("Set default close operation:");
		final JRadioButton exit = new JRadioButton("Exit Application");
		final JRadioButton minimize = new JRadioButton("Minimize");
		
		if(Settings.getInstance().getDefaultClose())
			exit.setSelected(true);
		else
			minimize.setSelected(true);
		
		exit.addActionListener(new ActionListener(){

			@Override
			public void actionPerformed(ActionEvent e) {
				if(!exit.isSelected()){
					exit.setSelected(true);
					minimize.setSelected(false);
				}
				else
					minimize.setSelected(false);
			}
			
		});
		
		minimize.addActionListener(new ActionListener(){

			@Override
			public void actionPerformed(ActionEvent arg0) {
				
				if(!minimize.isSelected()){
					exit.setSelected(false);
					minimize.setSelected(true);
				}
				else
					exit.setSelected(false);
			}
			
		});
		
		closePanel.setLayout(new FlowLayout());
		closePanel.add(dClose);
		closePanel.add(exit);
		closePanel.add(minimize);
		
		dateFormatPanel.setLayout(new FlowLayout());
		dateFormatPanel.add(new JLabel("Time format of the clock:"));
		
		String formats [] = {"HH:mm:ss" , "dd MMM yyyy HH:mm:ss" , "dd MMM HH:mm:ss"};
		@SuppressWarnings("unchecked")
		final JComboBox dateformats = new JComboBox(formats);
		
		dateFormatPanel.add(dateformats);
		
		
		clockPanel.setLayout(new FlowLayout());
		clockPanel.add(new JLabel("Colors of the clock:"));
		final JRadioButton Static = new JRadioButton("static");
		final JRadioButton changing = new JRadioButton("changing");
		
		clockPanel.add(Static);
		clockPanel.add(changing);
		
		if(!Settings.getInstance().getChangingColors())
			Static.setSelected(true);
		else
			changing.setSelected(true);
		
		Static.addActionListener(new ActionListener(){

			public void actionPerformed(ActionEvent e) {
				if(!Static.isSelected()){
					Static.setSelected(false);
					changing.setSelected(true);
				}
				else
					changing.setSelected(false);
			}
			
		});
		
		changing.addActionListener(new ActionListener(){

			@Override
			public void actionPerformed(ActionEvent e) {
				if(!changing.isSelected()){
					Static.setSelected(true);
					changing.setSelected(false);
				}
				else
					Static.setSelected(false);
				
			}
			
		});
		
		panel.setLayout(new BoxLayout(panel , BoxLayout.Y_AXIS));
		panel.add(closePanel);
		panel.add(dateFormatPanel);
		panel.add(clockPanel);
		
		mainPane.addTab("General", panel);
		///////////////////////////////////
		//////////////////////////////second tab
		JPanel panel2 = new JPanel();
		mainPane.addTab("Alarm",panel2);
		//////////////////////////////////
		mainPane.setVisible(true);
		mainPane.setSize(new Dimension(640,480));
		
		cancel.addActionListener(new ActionListener(){

			@Override
			public void actionPerformed(ActionEvent e) {
				f.dispose();	
			}
		});
		
		ok.addActionListener(new ActionListener(){

			@Override
			public void actionPerformed(ActionEvent e) {
				
				/////////////////////////////////////for default close operation
				if(exit.isSelected())
					Settings.getInstance().setDefaultClose(true);
				else
					Settings.getInstance().setDefaultClose(false);
				///////////////////////////////////// for date format
				String current = (String)dateformats.getSelectedItem();
				Settings.getInstance().setDateFormat(current);
				
				//////////////////////////////////// set changing colors
				if(Static.isSelected())
					Settings.getInstance().setChangingColors(false);
				else
					Settings.getInstance().setChangingColors(true);
				
				f.dispose();
			}
			
		});
		
		f.setLayout(new BoxLayout(f.getContentPane() , BoxLayout.Y_AXIS));
		f.add(mainPane);
		f.add(buttonPanel);
		f.setSize(new Dimension(640,480));
		f.setVisible(true);
		f.setAlwaysOnTop(true);
		f.setTitle("Settings");
	}