From fbfa7d72b66e7960335ff3450b7c8f34bbb04693 Mon Sep 17 00:00:00 2001 From: manzerbredes Date: Thu, 31 Mar 2016 11:12:01 +0200 Subject: Clean code and new release --- src/client/MainWindow.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/client') diff --git a/src/client/MainWindow.java b/src/client/MainWindow.java index 15baf4c..1147592 100644 --- a/src/client/MainWindow.java +++ b/src/client/MainWindow.java @@ -28,16 +28,15 @@ public class MainWindow extends JFrame { private Class driverType; private DriverManager drvMan=new DriverManager(); - public MainWindow() throws InstantiationException{ + public MainWindow(Driver aDriver) throws InstantiationException{ this.initUI(); - Driver drv=drvMan.getDevice(); - if(drv==null){ + if(aDriver==null){ System.err.println("No driver avalaible (try as root)"); System.exit(1); } else{ - this.driverType=drv.getType(); - this.keyboardTypeA=(DriverTypeA) drv; + this.driverType=aDriver.getType(); + this.keyboardTypeA=(DriverTypeA) aDriver; } this.left=new JComboBox<>(Color.values()); -- cgit v1.2.3