diff --git a/src/com/ixab/GUI/AlertWindow.form b/src/com/ixab/GUI/AlertWindow.form
new file mode 100644
index 0000000..57f0e9d
--- /dev/null
+++ b/src/com/ixab/GUI/AlertWindow.form
@@ -0,0 +1,64 @@
+
+
diff --git a/src/com/ixab/GUI/AlertWindow.java b/src/com/ixab/GUI/AlertWindow.java
new file mode 100644
index 0000000..6277496
--- /dev/null
+++ b/src/com/ixab/GUI/AlertWindow.java
@@ -0,0 +1,47 @@
+package com.ixab.GUI;
+
+import javax.swing.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+public class AlertWindow extends JDialog {
+ private JPanel contentPane;
+ private JButton buttonOK;
+ private JLabel message;
+
+ public AlertWindow(String s) {
+ message.setText(s);
+ setContentPane(contentPane);
+ setModal(true);
+ getRootPane().setDefaultButton(buttonOK);
+
+ buttonOK.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ onOK();
+ }
+ });
+ }
+
+ private void onOK() {
+// add your code here
+ dispose();
+ }
+
+ public void close() {
+ dispose();
+ }
+
+ public static void main(String[] args) {
+ AlertWindow dialog = new AlertWindow("unused main() in alertwindow");
+ dialog.pack();
+ dialog.setVisible(true);
+ System.exit(0);
+ }
+ public static AlertWindow main(String s) {
+ AlertWindow dialog = new AlertWindow(s);
+ dialog.pack();
+ dialog.setVisible(true);
+ System.exit(0);
+ return dialog;
+ }
+}
diff --git a/src/com/ixab/GUI/MainWindow.form b/src/com/ixab/GUI/MainWindow.form
index e8f777a..f54ca40 100644
--- a/src/com/ixab/GUI/MainWindow.form
+++ b/src/com/ixab/GUI/MainWindow.form
@@ -71,7 +71,7 @@
-
+
@@ -90,7 +90,7 @@
-
+
@@ -102,24 +102,40 @@
-
-
-
-
-
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/com/ixab/GUI/MainWindow.java b/src/com/ixab/GUI/MainWindow.java
index 8a0e929..35eee71 100644
--- a/src/com/ixab/GUI/MainWindow.java
+++ b/src/com/ixab/GUI/MainWindow.java
@@ -32,6 +32,8 @@ public class MainWindow {
private JLabel errorLabel;
private JButton buttonReloadStreamData;
+ private JButton vorherigerButton;
+ private JButton nächsterButton;
private boolean lockStreamInfoGetter = false;
public MainWindow() {
@@ -92,6 +94,26 @@ public class MainWindow {
updateStreamDetails();
}
});
+ nächsterButton.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ if (comboBoxStreams.getSelectedIndex()!=ConfigFileInstanceHandler.getConfig().getStreams().size()-1) {
+ comboBoxStreams.setSelectedIndex(comboBoxStreams.getSelectedIndex() + 1);
+ } else {
+ comboBoxStreams.setSelectedIndex(0);
+ }
+ }
+ });
+ vorherigerButton.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ if (comboBoxStreams.getSelectedIndex()!=0) {
+ comboBoxStreams.setSelectedIndex(comboBoxStreams.getSelectedIndex() - 1);
+ } else {
+ comboBoxStreams.setSelectedIndex(ConfigFileInstanceHandler.getConfig().getStreams().size()-1);
+ }
+ }
+ });
}
private void startUpdaterThread() {
if (updateThread != null) {
@@ -178,7 +200,11 @@ public class MainWindow {
ConfigFileInstanceHandler.getConfig().getStreams()) {
comboBoxStreams.addItem(stream);
}
- comboBoxStreams.setSelectedItem(o);
+ if (o != null) {
+ comboBoxStreams.setSelectedItem(o);
+ } else {
+ comboBoxStreams.setSelectedIndex(0);
+ }
}
private void refreshQualityComboBox() {
comboBoxQuality.removeAllItems();
diff --git a/src/com/ixab/Main.java b/src/com/ixab/Main.java
index 6732f4a..9946599 100644
--- a/src/com/ixab/Main.java
+++ b/src/com/ixab/Main.java
@@ -3,12 +3,13 @@ package com.ixab;
import com.ixab.ConfigHandling.Config;
import com.ixab.ConfigHandling.ConfigFileIOHandler;
import com.ixab.ConfigHandling.ConfigFileInstanceHandler;
+import com.ixab.GUI.AlertWindow;
import com.ixab.GUI.MainWindow;
import javax.swing.*;
public class Main {
- private final static String version = "0.4 Alpha";
+ private final static String version = "0.5 Alpha";
private static Config c = null;
public static void main(String[] args) {
try {