From 4df94321e002e4ce9cc49ee58caaa7415c5732bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=F8=EDk?= Date: Sat, 30 Jul 2011 14:31:31 +0200 Subject: [PATCH] AS1/2: Few gui fixes --- trunk/src/com/jpexs/asdec/action/gui/MainFrame.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/trunk/src/com/jpexs/asdec/action/gui/MainFrame.java b/trunk/src/com/jpexs/asdec/action/gui/MainFrame.java index 338576e7f..8e2216b69 100644 --- a/trunk/src/com/jpexs/asdec/action/gui/MainFrame.java +++ b/trunk/src/com/jpexs/asdec/action/gui/MainFrame.java @@ -191,7 +191,7 @@ public class MainFrame extends JFrame implements TreeSelectionListener, ActionLi public void valueChanged(TreeSelectionEvent e) { if (Main.isWorking()) return; - Object obj = ((JTree) e.getSource()).getLastSelectedPathComponent(); + Object obj = tagTree.getLastSelectedPathComponent(); if (obj instanceof TagTreeItem) { obj = ((TagTreeItem) obj).tag; if (obj instanceof ASMSource) { @@ -268,16 +268,18 @@ public class MainFrame extends JFrame implements TreeSelectionListener, ActionLi } } - if (e.getActionCommand().equals("SAVEACTION")) { + if (e.getActionCommand().equals("SAVEACTION")) { TagTreeItem ti = (TagTreeItem) tagTree.getLastSelectedPathComponent(); if (ti.tag instanceof ASMSource) { ASMSource dat = (ASMSource) ti.tag; try { dat.setActions(ASMParser.parse(new ByteArrayInputStream(editor.getText().getBytes()), 10),10); //TODO:Ensure correct version here + valueChanged(null); + JOptionPane.showMessageDialog(this, "Code successfully saved"); } catch (IOException ex) { } catch (ParseException ex) { JOptionPane.showMessageDialog(this, "" + ex.text + " on line " + ex.line, "Error", JOptionPane.ERROR_MESSAGE); - } + } } } if (e.getActionCommand().equals("SAVE")) {