Changeset 34153
- Timestamp:
- 2020-06-12T21:23:42+12:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/remote/ActionQueue.java
r18684 r34153 79 79 } 80 80 81 // We often end up with giant blotted remote build error messages when things blow up 82 // These messages appear in pop ups that take up the entire screen and we can't even see the OK button 83 // This method therefore adds a scrollPane around error messages when displaying them. 84 // https://alvinalexander.com/java/joptionpane-showmessagedialog-example-scrolling/ 85 private JScrollPane getMsgInScrollPane(String msg) { 86 // create a JTextArea 87 JTextArea textArea = new JTextArea(20, 70); 88 textArea.setText(msg); 89 textArea.setEditable(false); 90 // wrap a scrollpane around message 91 JScrollPane scrollPane = new JScrollPane(textArea); 92 return scrollPane; 93 } 81 94 82 95 synchronized public void addAction(RemoteGreenstoneServerAction remote_greenstone_server_action) … … 148 161 DebugStream.printStackTrace(exception); 149 162 } 150 JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("RemoteGreenstoneServer.Error", exception.getMessage()), Dictionary.get("RemoteGreenstoneServer.Error_Title"), JOptionPane.ERROR_MESSAGE); 163 JScrollPane scrollPane = getMsgInScrollPane(Dictionary.get("RemoteGreenstoneServer.Error", exception.getMessage())); 164 JOptionPane.showMessageDialog(Gatherer.g_man, scrollPane, Dictionary.get("RemoteGreenstoneServer.Error_Title"), JOptionPane.ERROR_MESSAGE); 151 165 remote_greenstone_server_action.processed_successfully = false; 152 166 } … … 156 170 exit = true; 157 171 DebugStream.printStackTrace(exception); 172 JScrollPane scrollPane = getMsgInScrollPane(Dictionary.get("RemoteGreenstoneServer.Error", 173 "No gliserver.pl found. " + exception.getMessage())); 158 174 JOptionPane.showMessageDialog(Gatherer.g_man, 159 Dictionary.get("RemoteGreenstoneServer.Error", 160 "No gliserver.pl found. " + exception.getMessage()), 175 scrollPane, 161 176 Dictionary.get("RemoteGreenstoneServer.Error_Title"), 162 177 JOptionPane.ERROR_MESSAGE); … … 165 180 catch (Exception exception) { 166 181 DebugStream.printStackTrace(exception); 167 JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("RemoteGreenstoneServer.Error", exception.getMessage()), Dictionary.get("RemoteGreenstoneServer.Error_Title"), JOptionPane.ERROR_MESSAGE); 182 JScrollPane scrollPane = getMsgInScrollPane(Dictionary.get("RemoteGreenstoneServer.Error", exception.getMessage())); 183 JOptionPane.showMessageDialog(Gatherer.g_man, scrollPane, Dictionary.get("RemoteGreenstoneServer.Error_Title"), JOptionPane.ERROR_MESSAGE); 168 184 remote_greenstone_server_action.processed_successfully = false; 169 185 }
Note:
See TracChangeset
for help on using the changeset viewer.