Skip to content
Snippets Groups Projects
Commit 6c0793c9 authored by Philipp Spohr's avatar Philipp Spohr
Browse files

small crashfixes

parent 49dbfa2c
No related branches found
No related tags found
No related merge requests found
...@@ -22,6 +22,7 @@ public class Core { ...@@ -22,6 +22,7 @@ public class Core {
CyNetwork currentNetwork = cy.getCurrentNetwork(); CyNetwork currentNetwork = cy.getCurrentNetwork();
if (currentNetwork == null) { if (currentNetwork == null) {
//TODO //TODO
return;
} }
LibraryInterface.setTimeLimit(timeLimit); LibraryInterface.setTimeLimit(timeLimit);
......
package de.hhu.ba.yoshikoWrapper.gui; package de.hhu.ba.yoshikoWrapper.gui;
import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
...@@ -17,10 +18,9 @@ public class TimeLimitSetter extends JPanel{ ...@@ -17,10 +18,9 @@ public class TimeLimitSetter extends JPanel{
private NumberInputField numberField; private NumberInputField numberField;
public TimeLimitSetter() { public TimeLimitSetter() {
checkBox = new JCheckBox(); checkBox = new JCheckBox("Use time limit (s):");
numberField = new NumberInputField(); numberField = new NumberInputField();
numberField.setEnabled(false); //By default time limit is turned off numberField.setEnabled(false); //By default time limit is turned off
numberField.setSize(40, 10);
checkBox.addActionListener( checkBox.addActionListener(
new ActionListener() { new ActionListener() {
...@@ -37,7 +37,7 @@ public class TimeLimitSetter extends JPanel{ ...@@ -37,7 +37,7 @@ public class TimeLimitSetter extends JPanel{
} }
public int getTimeLimit() { public int getTimeLimit() {
if (checkBox.isSelected()) { if (!checkBox.isSelected()) {
return -1; return -1;
} }
return numberField.getTimeLimit(); return numberField.getTimeLimit();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment