51 52 //setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 53 tabPane.setTabPlacement(JTabbedPane.TOP); 54 tabPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); 55 JPanel panel = new JPanel(); 56 panel.setPreferredSize(new Dimension(200, 300)); 57 tabPane.addTab("Number Zero", panel); 58 panel = new JPanel(); 59 //panel.requestFocus(); 60 panel.setPreferredSize(new Dimension(200, 300)); 61 tabPane.addTab("Number One", panel); 62 panel = new JPanel(); 63 panel.setPreferredSize(new Dimension(200, 300)); 64 tabPane.addTab("Number Two", panel); 65 panel = new JPanel(); 66 panel.setPreferredSize(new Dimension(200, 300)); 67 tabPane.addTab("Number Three", new JColorChooser()); 68 panel = new JPanel(); 69 panel.setPreferredSize(new Dimension(200, 300)); 70 tabPane.addTab("Number Four", panel); 71 mainPanel = new JPanel(); 72 mainPanel.add(tabPane); 73 74 getContentPane().add(mainPanel); 75 tabPane.requestFocus(); 76 77 78 //pack(); 79 //setVisible(true); 80 }); 81 } 82 83 public void init() { 84 String[][] instructionsSet = 85 { 86 { 87 " Note : Incase of Assertion failure,user can enter", 88 " remarks by pressing 'Assertion Fail Remarks ' button", 89 " ", 90 " You would see an applet with JTabbedPane. Keep the size of applet variable.", 91 " ", 92 " ON ALL PLATFORMS", 93 "1. Click on any of the tabs, focus indicator is visible", 94 "2. Lose focus on the window by clicking on some other window ", 95 "3. Focus indicator should disappear", 96 "4. Regain focus on the window the focus indicator should reappear." , 97 " If focus doesn't behave as above, ", 98 " press 'Assertion Fail' else press 'Assertion Pass'", 99 }, 100 101 { 102 " Note : Incase of Assertion failure,user can enter", 103 " remarks by pressing 'Assertion Fail Remarks ' button", 104 " ", 105 " You would see an applet with JTabbedPane. Keep the size of applet variable.", 106 " ", 107 " ON ALL PLATFORMS", 108 "1. type 'R' to align the tabs to the right side ", 109 "2. Lose focus on the window by clicking on some other window ", 110 "3. Focus indicator should disappear", 111 "4. Regain focus on the window the focus indicator should reappear." , 112 " If focus doesn't behave as above, ", 113 " press 'Assertion Fail' else press 'Assertion Pass'", 114 }, 115 116 { 117 " Note : Incase of Assertion failure,user can enter", 118 " remarks by pressing 'Assertion Fail Remarks ' button", 119 " ", 120 " You would see an applet with JTabbedPane. Keep the size of applet variable.", 121 " ", 122 " ON ALL PLATFORMS", 123 "1. type 'B' to align the tabs to the bottom side ", 124 "2. Lose focus on the window by clicking on some other window ", 125 "3. Focus indicator should disappear", 126 "4. Regain focus on the window the focus indicator should reappear." , 127 " If focus doesn't behave as above, ", 128 " press 'Assertion Fail' else press 'Assertion Pass'", 129 }, 130 131 { 132 " Note : Incase of Assertion failure,user can enter", 133 " remarks by pressing 'Assertion Fail Remarks ' button", 134 " ", 135 " You would see an applet with JTabbedPane. Keep the size of applet variable.", 136 " ", 137 " ON ALL PLATFORMS", 138 "1. type 'L' to align the tabs to the left side ", 139 "2. Lose focus on the window by clicking on some other window ", 140 "3. Focus indicator should disappear", 141 "4. Regain focus on the window the focus indicator should reappear." , 142 " If focus doesn't behave as above, ", 143 " press 'Assertion Fail' else press 'Assertion Pass'", 144 }, 145 146 { 147 " Note : Incase of Assertion failure,user can enter", 148 " remarks by pressing 'Assertion Fail Remarks ' button", 149 " ", 150 " You would see an applet with JTabbedPane. Keep the size of applet variable.", 151 " ", 152 " ON ALL PLATFORMS", 153 "1. type 'C' to change the tab layout to WRAP_TAB_LAYOUT ", 154 "2. Lose focus on the window by clicking on some other window ", 155 "3. Focus indicator should disappear", 156 "4. Regain focus on the window the focus indicator should reappear." , 157 " If focus doesn't behave as above, ", 158 " press 'Assertion Fail' else press 'Assertion Pass'", 159 }, 160 161 { 162 " Note : Incase of Assertion failure,user can enter", 163 " remarks by pressing 'Assertion Fail Remarks ' button", 164 " ", 165 " You would see an applet with JTabbedPane. Keep the size of applet variable.", 166 " ", 167 " ON ALL PLATFORMS", 168 "1. type 'T' to align the tabs to the top side ", 169 "2. Lose focus on the window by clicking on some other window ", 170 "3. Focus indicator should disappear", 171 "4. Regain focus on the window the focus indicator should reappear." , 172 " If focus doesn't behave as above, ", 173 " press 'Assertion Fail' else press 'Assertion Pass'", 174 }, 175 176 { 177 " Note : Incase of Assertion failure,user can enter", 178 " remarks by pressing 'Assertion Fail Remarks ' button", 179 " ", | 51 52 //setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 53 tabPane.setTabPlacement(JTabbedPane.TOP); 54 tabPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); 55 JPanel panel = new JPanel(); 56 panel.setPreferredSize(new Dimension(200, 300)); 57 tabPane.addTab("Number Zero", panel); 58 panel = new JPanel(); 59 //panel.requestFocus(); 60 panel.setPreferredSize(new Dimension(200, 300)); 61 tabPane.addTab("Number One", panel); 62 panel = new JPanel(); 63 panel.setPreferredSize(new Dimension(200, 300)); 64 tabPane.addTab("Number Two", panel); 65 panel = new JPanel(); 66 panel.setPreferredSize(new Dimension(200, 300)); 67 tabPane.addTab("Number Three", new JColorChooser()); 68 panel = new JPanel(); 69 panel.setPreferredSize(new Dimension(200, 300)); 70 tabPane.addTab("Number Four", panel); 71 panel = new JPanel(); 72 panel.setPreferredSize(new Dimension(200, 300)); 73 tabPane.addTab("Number Five", panel); 74 panel = new JPanel(); 75 panel.setPreferredSize(new Dimension(200, 300)); 76 tabPane.addTab("Number Six", panel); 77 panel = new JPanel(); 78 panel.setPreferredSize(new Dimension(200, 300)); 79 tabPane.addTab("Number Seven", panel); 80 panel = new JPanel(); 81 panel.setPreferredSize(new Dimension(200, 300)); 82 tabPane.addTab("Number Eight", panel); 83 panel = new JPanel(); 84 panel.setPreferredSize(new Dimension(200, 300)); 85 tabPane.addTab("Number Nine", panel); 86 panel = new JPanel(); 87 panel.setPreferredSize(new Dimension(200, 300)); 88 tabPane.addTab("Number Ten", panel); 89 mainPanel = new JPanel(); 90 mainPanel.add(tabPane); 91 92 getContentPane().add(mainPanel); 93 tabPane.requestFocus(); 94 95 96 //pack(); 97 //setVisible(true); 98 }); 99 } 100 101 public void init() { 102 String[][] instructionsSet = 103 { 104 { 105 " Note : Incase of Assertion failure,user can enter", 106 " remarks by pressing 'Assertion Fail Remarks ' button", 107 " ", 108 " You would see an applet with JTabbedPane. Keep the size of applet variable.", 109 " ", 110 " ON ALL PLATFORMS", 111 "1. Click on any of the tabs, focus indicator is visible", 112 "2. Lose focus on the window by clicking on some other window ", 113 "3. Focus indicator should disappear", 114 "4. Regain focus on the window the focus indicator should reappear." , 115 " If focus doesn't behave as above, ", 116 " press 'Assertion Fail' else press 'Assertion Pass'", 117 }, 118 { 119 " Note : Incase of Assertion failure,user can enter", 120 " remarks by pressing 'Assertion Fail Remarks ' button", 121 " ", 122 " You would see an applet with JTabbedPane. Keep the size of applet variable.", 123 " ", 124 " ON ALL PLATFORMS", 125 "1. type 'C' to change the tab layout to WRAP_TAB_LAYOUT ", 126 "2. Lose focus on the window by clicking on some other window ", 127 "3. Focus indicator should disappear", 128 "4. Regain focus on the window the focus indicator should reappear." , 129 " If focus doesn't behave as above, ", 130 " press 'Assertion Fail' else press 'Assertion Pass'", 131 }, 132 133 { 134 " Note : Incase of Assertion failure,user can enter", 135 " remarks by pressing 'Assertion Fail Remarks ' button", 136 " ", 137 " You would see an applet with JTabbedPane. Keep the size of applet variable.", 138 " ", 139 " ON ALL PLATFORMS", 140 "1. type 'R' to align the tabs to the right side ", 141 "2. Lose focus on the window by clicking on some other window ", 142 "3. Focus indicator should disappear", 143 "4. Regain focus on the window the focus indicator should reappear." , 144 " If focus doesn't behave as above, ", 145 " press 'Assertion Fail' else press 'Assertion Pass'", 146 }, 147 148 { 149 " Note : Incase of Assertion failure,user can enter", 150 " remarks by pressing 'Assertion Fail Remarks ' button", 151 " ", 152 " You would see an applet with JTabbedPane. Keep the size of applet variable.", 153 " ", 154 " ON ALL PLATFORMS", 155 "1. type 'B' to align the tabs to the bottom side ", 156 "2. Lose focus on the window by clicking on some other window ", 157 "3. Focus indicator should disappear", 158 "4. Regain focus on the window the focus indicator should reappear." , 159 " If focus doesn't behave as above, ", 160 " press 'Assertion Fail' else press 'Assertion Pass'", 161 }, 162 163 { 164 " Note : Incase of Assertion failure,user can enter", 165 " remarks by pressing 'Assertion Fail Remarks ' button", 166 " ", 167 " You would see an applet with JTabbedPane. Keep the size of applet variable.", 168 " ", 169 " ON ALL PLATFORMS", 170 "1. type 'L' to align the tabs to the left side ", 171 "2. Lose focus on the window by clicking on some other window ", 172 "3. Focus indicator should disappear", 173 "4. Regain focus on the window the focus indicator should reappear." , 174 " If focus doesn't behave as above, ", 175 " press 'Assertion Fail' else press 'Assertion Pass'", 176 }, 177 178 179 { 180 " Note : Incase of Assertion failure,user can enter", 181 " remarks by pressing 'Assertion Fail Remarks ' button", 182 " ", 183 " You would see an applet with JTabbedPane. Keep the size of applet variable.", 184 " ", 185 " ON ALL PLATFORMS", 186 "1. type 'T' to align the tabs to the top side ", 187 "2. Lose focus on the window by clicking on some other window ", 188 "3. Focus indicator should disappear", 189 "4. Regain focus on the window the focus indicator should reappear." , 190 " If focus doesn't behave as above, ", 191 " press 'Assertion Fail' else press 'Assertion Pass'", 192 }, 193 194 { 195 " Note : Incase of Assertion failure,user can enter", 196 " remarks by pressing 'Assertion Fail Remarks ' button", 197 " ", |