You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by bu...@apache.org on 2001/07/30 17:07:28 UTC
[Bug 2893] New: - repaint of JFrame
PLEASE DO NOT REPLY TO THIS MESSAGE. TO FURTHER COMMENT
ON THE STATUS OF THIS BUG PLEASE FOLLOW THE LINK BELOW
AND USE THE ON-LINE APPLICATION. REPLYING TO THIS MESSAGE
DOES NOT UPDATE THE DATABASE, AND SO YOUR COMMENT WILL
BE LOST SOMEWHERE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2893
*** shadow/2893 Mon Jul 30 08:07:28 2001
--- shadow/2893.tmp.25375 Mon Jul 30 08:07:28 2001
***************
*** 0 ****
--- 1,81 ----
+ +============================================================================+
+ | repaint of JFrame |
+ +----------------------------------------------------------------------------+
+ | Bug #: 2893 Product: JMeter |
+ | Status: NEW Version: 1.5 |
+ | Resolution: Platform: PC |
+ | Severity: Minor OS/Version: Windows 9x |
+ | Priority: Other Component: Main |
+ +----------------------------------------------------------------------------+
+ | Assigned To: jmeter-dev@jakarta.apache.org |
+ | Reported By: bo.regnlin@pc.nu |
+ | CC list: Cc: |
+ +----------------------------------------------------------------------------+
+ | URL: |
+ +============================================================================+
+ | DESCRIPTION |
+ When I use the Gui and try to open or save via a rightclick on a node in the
+ tree and then enter cancel the popup sometimes is still visable.
+ I have found out why and its due to the fact that in the code you need to
+ repaint the frame after a popup is shown.
+ Se my exampel that I have tried and it seems to do the work.
+
+ In file org.apache.jmeter.gui.action.Load.java look for <new code>
+
+ public void doAction(ActionEvent e)
+ {
+ JFileChooser chooser = FileDialoger.promptToOpenFile();
+ FileInputStream reader = null;
+ try {
+ File f = chooser.getSelectedFile();
+ if (f!=null) {
+ reader = new FileInputStream(f);
+ XmlHandler handler =
+ new XmlHandler(new JMeterNameSpaceHandler());
+ XMLReader parser = JMeterUtils.getXMLParser();
+ parser.setContentHandler(handler);
+ parser.setErrorHandler(handler);
+ parser.parse(new InputSource(reader));
+ ListedHashTree tree = handler.getDataTree();
+ GuiPackage.getInstance().addSubTree(handler.getDataTree
+ ());
+ }
+ }
+ catch (Throwable ex) {
+ ex.printStackTrace();
+ //<new code> }
+ finally
+ {
+ GuiPackage.getInstance().getMainFrame().repaint();
+ }
+ //</new code>
+ }
+
+ And in file org.apache.jmeter.gui.action.Save.java
+
+ public void doAction(ActionEvent e) {
+ JMeterComponentModel model = GuiPackage.getInstance
+ ().getCurrentModel();
+ if (model instanceof Saveable) {
+ JFileChooser chooser = FileDialoger.promptToSaveFile
+ (model.getName() + ".jmx");
+ FileWriter writer = null;
+ try {
+ writer = new FileWriter(chooser.getSelectedFile
+ ());
+ TagHandler handler = (TagHandler) ((Saveable)
+ model).getTagHandlerClass().newInstance();
+ handler.startSave(writer);
+ handler.save((Saveable) model, writer);
+ }
+ catch (Throwable ex) {
+ ex.printStackTrace();
+ }
+ finally {
+ closeWriter(writer);
+ //<new code>
+ GuiPackage.getInstance().getMainFrame().repaint();
+ //</new code>
+ }
+ }
+ }
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org