1 19 20 package org.netbeans.modules.welcome.ui; 21 22 import java.awt.BorderLayout ; 23 import java.awt.event.ActionEvent ; 24 import java.awt.event.ActionListener ; 25 import javax.swing.JCheckBox ; 26 import javax.swing.JPanel ; 27 import javax.swing.event.ChangeEvent ; 28 import org.netbeans.modules.welcome.WelcomeOptions; 29 import org.netbeans.modules.welcome.content.BundleSupport; 30 import org.netbeans.modules.welcome.content.Constants; 31 import org.netbeans.modules.welcome.content.Utils; 32 33 37 public class ShowNextTime extends JPanel implements ActionListener , Constants { 38 39 private JCheckBox button; 40 41 42 public ShowNextTime() { 43 super( new BorderLayout () ); 44 45 setOpaque( false ); 46 47 button = new JCheckBox ( BundleSupport.getLabel( "ShowOnStartup" ) ); button.setSelected( WelcomeOptions.getDefault().isShowOnStartup() ); 49 button.setFont( BUTTON_FONT ); 50 button.setForeground( Utils.getColor(BUTTON_TEXT_COLOR) ); 51 button.setBackground( Utils.getColor(DEFAULT_BACKGROUND_COLOR) ); 52 button.setOpaque( false ); 53 BundleSupport.setAccessibilityProperties( button, "ShowOnStartup" ); add( button, BorderLayout.CENTER ); 55 button.addActionListener( this ); 56 } 57 58 public void stateChanged(ChangeEvent e) { 59 WelcomeOptions.getDefault().setShowOnStartup( button.isSelected() ); 60 } 61 62 public void actionPerformed(ActionEvent e) { 63 WelcomeOptions.getDefault().setShowOnStartup( button.isSelected() ); 64 } 65 } 66 | Popular Tags |