diff --git a/src/SwingPresenter.java b/src/SwingPresenter.java index 58057a4..e5f9be6 100644 --- a/src/SwingPresenter.java +++ b/src/SwingPresenter.java @@ -34,7 +34,6 @@ components.put(key, label); } else if (type.equals("button")) { JButton button = new JButton(text); - button.setSize(100, 20); mainPanel.add(button); components.put(key, button); } else if (type.equals("table")) { diff --git a/src/Widget.java b/src/Widget.java index 7e65f98..f411dc9 100644 --- a/src/Widget.java +++ b/src/Widget.java @@ -25,7 +25,7 @@ return temp_nil0; } public String getType() { - return type; + return this.type; } public int getY() { return this.y; diff --git a/src/Widget1.java b/src/Widget1.java index 2d87115..b0170fb 100644 --- a/src/Widget1.java +++ b/src/Widget1.java @@ -23,7 +23,7 @@ return temp_nil2; } public String getType() { - return type; + return this.type; } public int getY() { return this.y; @@ -52,7 +52,13 @@ } public Widget1(String type, boolean visible, int width, int x, int y, String text, int state, int height, CurScreen curScreen) { this.type = type; + this.visible = visible; + this.width = width; + this.x = x; + this.y = y; + this.text = text; this.state = state; + this.height = height; this.curScreen = curScreen; } } \ No newline at end of file diff --git a/src/Widgets.java b/src/Widgets.java index 528d893..0e00d37 100644 --- a/src/Widgets.java +++ b/src/Widgets.java @@ -10,7 +10,7 @@ public void setValue(Map value) { for (String key: value.keySet()) { String type = ""; - if (((Map) value.get(key)).get("type") != null) type = (String) ((Map) value.get(key)).get("type"); + if (((Map) value.get(key)) != null) type = (String) ((Map) value.get(key)).get("type"); int y = 0; if (((Map) value.get(key)) != null) y = (int) ((Map) value.get(key)).get("y"); int x = 0;