Code example for Queue

Methods: isEmptysizepoll

0
			exceptionQueue.add(new ExceptionSaver(e, msg));
		} else { 
			exceptionDisplayActive = true;
			 
			String okMsg = "Ok";
			int numExceptions = exceptionQueue.size();
			if (numExceptions > 0) {
				okMsg += " (" + numExceptions + " more)";
			} 
			List<String> options = new ArrayList<String>();
			options.add(okMsg);
			options.add("Copy to Clipboard");
 
			if (numExceptions > 0) {
				options.add("Ignore All");
			} 
 
 
			JSheet.showOptionSheet(JakeContext.getFrame(), 
							"<html><h2>" + msg + "</h2><br><font size=2>" + getExceptionText(e,
											"<br>", 20) + "</font><br><br>" + getApologyText() + "</html>", 
							JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, options.toArray(),
							options.get(0), new SheetListener() {
								@Override public void optionSelected(SheetEvent evt) {
									if (evt.getOption() == 1) {
										CopyText copyText = new CopyText();
										copyText.setString(clipBoard);
									}else if(evt.getOption() == 2) {
										exceptionQueue.clear();
									} 
								} 
							}); 
 
			// done - display more? 
			exceptionDisplayActive = false;
 
			if(!exceptionQueue.isEmpty()) {
				ExceptionSaver exs = exceptionQueue.poll();
				internalShowError(exs.msg, exs.exception);
			} 
		} 
	} 
 
Stop searching for code, let great code find you!  Add Codota to your java IDE