avatar

937

Add a 'Submit Log' button to the log viewer which sends me the log file via S3, and makes a note at my.jbidwatcher.com that it's been uploaded.

by mrs, 30 May, 2009 10:51 PM
932 937  
11971197       logText = EMPTY_LOG;
11981198     }
11991199 
1200     JFrame logFrame = _oui.showTextDisplay(logText, logBoxSize, Constants.PROGRAM_NAME + " " + frameName, false);
1200     JFrame logFrame = _oui.getTextDisplay(logText, logBoxSize, Constants.PROGRAM_NAME + " " + frameName, false);
1201     JButton logButton = new JButton("Submit Log");
1202     logButton.addActionListener(new ActionListener() {
1203       public void actionPerformed(ActionEvent e) {
1204         DoSubmitLogFile();
1205       }
1206     });
1207     JPanel buttonBox = new JPanel(new BorderLayout());
1208     buttonBox.add(logButton, BorderLayout.EAST);
1209     logFrame.add(buttonBox, BorderLayout.SOUTH);
1210 
1211     logFrame.pack();
1212     logFrame.setSize(logBoxSize.width, logBoxSize.height);
1213     logFrame.setVisible(true);
12011214     logFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
12021215   }
12031216 
913 937  
254254    * @return - The JFrame of the display.
255255    */
256256   public JFrame showTextDisplay(StringBuffer inSB, Dimension inSize, String frameName, boolean isHTML) {
257     JFrame otherFrame = getTextDisplay(inSB, inSize, frameName, isHTML);
258     otherFrame.pack();
259     otherFrame.setSize(inSize.width, inSize.height);
260     otherFrame.setVisible(true);
261 
262     return otherFrame;
263   }
264 
265   public JFrame getTextDisplay(StringBuffer inSB, Dimension inSize, String frameName, boolean isHTML) {
257266     JFrame otherFrame;
258267     JBEditorPane jep;
259268     JScrollPane jsp;
------
267276     otherFrame.getContentPane().add(jsp);
268277     jep.setCaretPosition(0);
269278     otherFrame.setLocation(getCenter(inSize));
270     otherFrame.pack();
271     otherFrame.setSize(inSize.width, inSize.height);
272     otherFrame.setVisible(true);
273 
274279     return otherFrame;
275280   }
276281