} else {
alarmTimeInputField.setEnabled(true);
}
alarmSchedHelpText.setText("To set the alarm schedule, please click on the tap in the top of the window");
GroupLayout AlarmPanelLayout = new GroupLayout(alarmPanel);
alarmPanel.setLayout(AlarmPanelLayout);
titledBorder = BorderFactory.createTitledBorder(loweredetched, "Alarm Settings");
alarmPanel.setBorder(titledBorder);
AlarmPanelLayout.setHorizontalGroup(
AlarmPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(AlarmPanelLayout.createSequentialGroup().addContainerGap().addGroup(AlarmPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(AlarmPanelLayout.createSequentialGroup().
addComponent(dailyAlarmRadioButton).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).
addComponent(alarmScheduleRadioButton)).
addComponent(alarmSchedHelpText).addGroup(AlarmPanelLayout.createSequentialGroup().
addComponent(alarmTimeInputField, GroupLayout.PREFERRED_SIZE, 57, GroupLayout.PREFERRED_SIZE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED))).addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
AlarmPanelLayout.setVerticalGroup(
AlarmPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(AlarmPanelLayout.createSequentialGroup().addContainerGap().addGroup(AlarmPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE).
addComponent(dailyAlarmRadioButton).
addComponent(alarmScheduleRadioButton)).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addGroup(AlarmPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE).
addComponent(alarmTimeInputField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 15, Short.MAX_VALUE).
addComponent(alarmSchedHelpText).addContainerGap()));
mathCheck.setText("Math");
mathCheck.addItemListener(new ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
taskBoxesStateChanged(evt);
}
});
taskSettingsTitel.setText("Choose which tasks to use");
mathMultiplyCheck.setText("Multiply");
mathSubtractionCheck.setText("Subtraction");
mathAdditionCheck.setText("Addition");
binaryCheck.setText("Binary");
if(settings.getTaskSettings().getBin()){
binaryCheck.setSelected(true);
}
shapesCheck.setText("Shapes");
if(settings.getTaskSettings().getShapes()){
shapesCheck.setSelected(true);
}
oddoneoutCheck.setText("OddOneOut");
if(settings.getTaskSettings().getOdd()){
oddoneoutCheck.setSelected(true);
}
if(settings.getTaskSettings().isMat()){
mathCheck.setSelected(true);
}
if(settings.getTaskSettings().getMath()[0]==1){
mathAdditionCheck.setSelected(true);
}
if(settings.getTaskSettings().getMath()[1]==1){
mathSubtractionCheck.setSelected(true);
}
if(settings.getTaskSettings().getMath()[2]==1){
mathMultiplyCheck.setSelected(true);
}
if(!mathCheck.isSelected()){
mathAdditionCheck.setEnabled(false);
mathMultiplyCheck.setEnabled(false);
mathSubtractionCheck.setEnabled(false);
}
showExButton.setText("Show Examples");
difficultyTitel.setText("Difficulty");
difEasy.setText("Kiddie");
difNormal.setText("Normal");
difHard.setText("You're NEVER turning this off");
if(settings.getTaskSettings().getDifficulty()==1){
difEasy.setSelected(true);
}else if(settings.getTaskSettings().getDifficulty()==2){
difNormal.setSelected(true);
}else{
difHard.setSelected(true);
}
difficultyGroup = new ButtonGroup();
difficultyGroup.add(difEasy);
difficultyGroup.add(difNormal);
difficultyGroup.add(difHard);
GroupLayout taskSettingsPanelLayout = new GroupLayout(taskSettingsPanel);
taskSettingsPanel.setLayout(taskSettingsPanelLayout);
titledBorder = BorderFactory.createTitledBorder(loweredetched, "Task settings");
taskSettingsPanel.setBorder(titledBorder);
taskSettingsPanelLayout.setHorizontalGroup(
taskSettingsPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(taskSettingsPanelLayout.createSequentialGroup().addContainerGap().addGroup(taskSettingsPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(taskSettingsPanelLayout.createSequentialGroup().
addComponent(difEasy).addGap(18, 18, 18).
addComponent(difNormal).addGap(18, 18, 18).
addComponent(difHard)).
addComponent(taskSettingsTitel).addGroup(taskSettingsPanelLayout.createSequentialGroup().addGroup(taskSettingsPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).
addComponent(mathCheck).addGroup(taskSettingsPanelLayout.createSequentialGroup().addGap(21, 21, 21).addGroup(taskSettingsPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).
addComponent(mathAdditionCheck).
addComponent(mathMultiplyCheck).
addComponent(mathSubtractionCheck)))).addGap(96, 96, 96).addGroup(taskSettingsPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).
addComponent(showExButton).
addComponent(oddoneoutCheck).
addComponent(shapesCheck).
addComponent(binaryCheck))).addGroup(GroupLayout.Alignment.TRAILING, taskSettingsPanelLayout.createSequentialGroup().
addComponent(difficultyTitel).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).
addComponent(jSeparator4, GroupLayout.DEFAULT_SIZE, 310, Short.MAX_VALUE))).addContainerGap()));
taskSettingsPanelLayout.setVerticalGroup(
taskSettingsPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(taskSettingsPanelLayout.createSequentialGroup().
addComponent(taskSettingsTitel).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addGroup(taskSettingsPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE).
addComponent(mathCheck).
addComponent(binaryCheck)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(taskSettingsPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE).
addComponent(mathMultiplyCheck).
addComponent(shapesCheck)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(taskSettingsPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE).
addComponent(mathAdditionCheck).
addComponent(oddoneoutCheck)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(taskSettingsPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE).
addComponent(mathSubtractionCheck).
addComponent(showExButton)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(taskSettingsPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).
addComponent(jSeparator4, GroupLayout.PREFERRED_SIZE, 10, GroupLayout.PREFERRED_SIZE).
addComponent(difficultyTitel)).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addGroup(taskSettingsPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE).
addComponent(difEasy).
addComponent(difNormal).
addComponent(difHard)).addGap(15, 15, 15)));
loadButton.setText("Load");
cancelButton.setText("Cancel");
saveButton.setText("Save");
saveButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
saveButtonActionPerformed(evt);
}
});
defaultButton.setText("Default");
defaultButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
defaultButtonActionPerformed(evt);
}
});
snoozeSlider.addChangeListener(new javax.swing.event.ChangeListener() {
public void stateChanged(javax.swing.event.ChangeEvent evt) {
snoozeSliderStateChanged(evt);
}
});
GroupLayout generalSettingsTapLayout = new GroupLayout(generalSettingsTap);
generalSettingsTap.setLayout(generalSettingsTapLayout);
generalSettingsTapLayout.setHorizontalGroup(
generalSettingsTapLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(generalSettingsTapLayout.createSequentialGroup().addContainerGap().addGroup(generalSettingsTapLayout.createParallelGroup(GroupLayout.Alignment.LEADING).
addComponent(alarmPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).
addComponent(jSeparator2, GroupLayout.Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE).
addComponent(jSeparator1, GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE).
addComponent(generalTitel).addGroup(generalSettingsTapLayout.createSequentialGroup().
addComponent(alarmSoundLabel).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).
addComponent(pathTextF, GroupLayout.PREFERRED_SIZE, 228, GroupLayout.PREFERRED_SIZE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).
addComponent(browseForSound)).
addComponent(snoozeEnable).addGroup(generalSettingsTapLayout.createSequentialGroup().
addComponent(snoozeLabel).addGroup(generalSettingsTapLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(generalSettingsTapLayout.createSequentialGroup().addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).
addComponent(snoozeSlider, GroupLayout.PREFERRED_SIZE, 229, GroupLayout.PREFERRED_SIZE)).addGroup(GroupLayout.Alignment.TRAILING, generalSettingsTapLayout.createSequentialGroup().addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 261, Short.MAX_VALUE).
addComponent(snoozeSetting).addGap(29, 29, 29)))).
addComponent(jSeparator3, GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE).
addComponent(taskSettingsPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addGroup(GroupLayout.Alignment.TRAILING, generalSettingsTapLayout.createSequentialGroup().
addComponent(saveButton).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).
addComponent(loadButton).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).
addComponent(defaultButton).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).
addComponent(cancelButton))).addContainerGap()));
generalSettingsTapLayout.setVerticalGroup(
generalSettingsTapLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(generalSettingsTapLayout.createSequentialGroup().addContainerGap().
addComponent(generalTitel).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).
addComponent(jSeparator1, GroupLayout.PREFERRED_SIZE, 10, GroupLayout.PREFERRED_SIZE).addGap(3, 3, 3).addGroup(generalSettingsTapLayout.createParallelGroup(GroupLayout.Alignment.BASELINE).
addComponent(alarmSoundLabel).
addComponent(pathTextF, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).
addComponent(browseForSound)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).
addComponent(jSeparator2, GroupLayout.PREFERRED_SIZE, 10, GroupLayout.PREFERRED_SIZE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).
addComponent(snoozeEnable).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addGroup(generalSettingsTapLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(generalSettingsTapLayout.createParallelGroup(GroupLayout.Alignment.BASELINE).
addComponent(snoozeLabel).
addComponent(snoozeSetting)).
addComponent(snoozeSlider, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)).addGap(18, 18, 18).
addComponent(jSeparator3, GroupLayout.PREFERRED_SIZE, 10, GroupLayout.PREFERRED_SIZE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).
addComponent(alarmPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addGap(18, 18, 18).
addComponent(taskSettingsPanel, GroupLayout.PREFERRED_SIZE, 215, GroupLayout.PREFERRED_SIZE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(generalSettingsTapLayout.createParallelGroup(GroupLayout.Alignment.BASELINE).
addComponent(cancelButton).
addComponent(defaultButton).
addComponent(loadButton).
addComponent(saveButton)).addContainerGap(13, Short.MAX_VALUE)));
jTabbedPane1.addTab("General Settings", generalSettingsTap);
alarmShedTitel.setText("Alarm Schedule");
// GroupLayout alarmScheduleTapLayout = new GroupLayout(alarmScheduleTap);
// alarmScheduleTap.setLayout(alarmScheduleTapLayout);
// alarmScheduleTapLayout.setHorizontalGroup(
// alarmScheduleTapLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(alarmScheduleTapLayout.createSequentialGroup().addContainerGap().
// addComponent(alarmShedTitel).addContainerGap(313, Short.MAX_VALUE)));
// alarmScheduleTapLayout.setVerticalGroup(
// alarmScheduleTapLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(alarmScheduleTapLayout.createSequentialGroup().addContainerGap().
// addComponent(alarmShedTitel).addContainerGap(487, Short.MAX_VALUE)));
jTabbedPane1.addTab("Alarm Schedule", new Schedule());
GroupLayout layout = new GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(GroupLayout.Alignment.LEADING).
addComponent(jTabbedPane1, GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE));
layout.setVerticalGroup(
layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().
addComponent(jTabbedPane1, GroupLayout.PREFERRED_SIZE, 645, GroupLayout.PREFERRED_SIZE).addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
// Set size of window here ^^^
pack();
}// </editor-fold>