@@ -336,6 +336,16 @@ private void focusCellEditorChanged() {
336336 table .setSurrendersFocusOnKeystroke ( focusCellEditorCheckBox .isSelected () );
337337 }
338338
339+ private void alternatingRowsChanged () {
340+ UIManager .put ( "Table.alternateRowColor" , alternatingRowsCheckBox .isSelected () ? Color .orange : null );
341+ table1ScrollPane .repaint ();
342+ }
343+
344+ private void paintOutsideAlternateRowsChanged () {
345+ UIManager .put ( "Table.paintOutsideAlternateRows" , paintOutsideAlternateRowsCheckBox .isSelected () ? true : null );
346+ table1ScrollPane .repaint ();
347+ }
348+
339349 private void treeRendererChanged () {
340350 Object sel = treeRendererComboBox .getSelectedItem ();
341351 if ( !(sel instanceof String ) )
@@ -493,8 +503,10 @@ private void initComponents() {
493503 focusCellEditorCheckBox = new JCheckBox ();
494504 showVerticalLinesCheckBox = new JCheckBox ();
495505 columnSelectionCheckBox = new JCheckBox ();
506+ alternatingRowsCheckBox = new JCheckBox ();
496507 intercellSpacingCheckBox = new JCheckBox ();
497508 rowHeaderCheckBox = new JCheckBox ();
509+ paintOutsideAlternateRowsCheckBox = new JCheckBox ();
498510 redGridColorCheckBox = new JCheckBox ();
499511 tableHeaderButtonCheckBox = new JCheckBox ();
500512
@@ -875,6 +887,11 @@ public void mouseClicked(MouseEvent e) {
875887 columnSelectionCheckBox .addActionListener (e -> columnSelectionChanged ());
876888 tableOptionsPanel .add (columnSelectionCheckBox , "cell 1 2" );
877889
890+ //---- alternatingRowsCheckBox ----
891+ alternatingRowsCheckBox .setText ("alternating rows" );
892+ alternatingRowsCheckBox .addActionListener (e -> alternatingRowsChanged ());
893+ tableOptionsPanel .add (alternatingRowsCheckBox , "cell 2 2" );
894+
878895 //---- intercellSpacingCheckBox ----
879896 intercellSpacingCheckBox .setText ("intercell spacing" );
880897 intercellSpacingCheckBox .addActionListener (e -> intercellSpacingChanged ());
@@ -885,6 +902,11 @@ public void mouseClicked(MouseEvent e) {
885902 rowHeaderCheckBox .addActionListener (e -> rowHeaderChanged ());
886903 tableOptionsPanel .add (rowHeaderCheckBox , "cell 1 3" );
887904
905+ //---- paintOutsideAlternateRowsCheckBox ----
906+ paintOutsideAlternateRowsCheckBox .setText ("outside alternating rows" );
907+ paintOutsideAlternateRowsCheckBox .addActionListener (e -> paintOutsideAlternateRowsChanged ());
908+ tableOptionsPanel .add (paintOutsideAlternateRowsCheckBox , "cell 2 3" );
909+
888910 //---- redGridColorCheckBox ----
889911 redGridColorCheckBox .setText ("red grid color" );
890912 redGridColorCheckBox .addActionListener (e -> redGridColorChanged ());
@@ -927,8 +949,10 @@ public void mouseClicked(MouseEvent e) {
927949 private JCheckBox focusCellEditorCheckBox ;
928950 private JCheckBox showVerticalLinesCheckBox ;
929951 private JCheckBox columnSelectionCheckBox ;
952+ private JCheckBox alternatingRowsCheckBox ;
930953 private JCheckBox intercellSpacingCheckBox ;
931954 private JCheckBox rowHeaderCheckBox ;
955+ private JCheckBox paintOutsideAlternateRowsCheckBox ;
932956 private JCheckBox redGridColorCheckBox ;
933957 private JCheckBox tableHeaderButtonCheckBox ;
934958 // JFormDesigner - End of variables declaration //GEN-END:variables
0 commit comments