List of usage examples for java.lang Exception getMessage
public String getMessage()
From source file:FontFactoryFontsPDF.java
public static void main(String[] args) { Document document = new Document(); try {// w w w.j a v a 2 s .c o m PdfWriter.getInstance(document, new FileOutputStream("FontFactoryFontsPDF.pdf")); document.open(); document.add(new Paragraph("FontFactory.getFont(FontFactory.COURIER, Font.DEFAULTSIZE, Font.NORMAL)", FontFactory.getFont(FontFactory.COURIER, Font.DEFAULTSIZE, Font.NORMAL))); document.add(new Paragraph("FontFactory.getFont(FontFactory.COURIER, Font.DEFAULTSIZE, Font.ITALIC)", FontFactory.getFont(FontFactory.COURIER, Font.DEFAULTSIZE, Font.ITALIC))); document.add(new Paragraph("FontFactory.getFont(FontFactory.COURIER, Font.DEFAULTSIZE, Font.BOLD)", FontFactory.getFont(FontFactory.COURIER, Font.DEFAULTSIZE, Font.BOLD))); document.add(new Paragraph( "FontFactory.getFont(FontFactory.COURIER, Font.DEFAULTSIZE, Font.BOLD | Font.ITALIC)", FontFactory.getFont(FontFactory.COURIER, Font.DEFAULTSIZE, Font.BOLD | Font.ITALIC))); document.add(new Paragraph("FontFactory.getFont(FontFactory.HELVETICA, Font.DEFAULTSIZE, Font.NORMAL)", FontFactory.getFont(FontFactory.HELVETICA, Font.DEFAULTSIZE, Font.NORMAL))); document.add(new Paragraph("FontFactory.getFont(FontFactory.HELVETICA, Font.DEFAULTSIZE, Font.ITALIC)", FontFactory.getFont(FontFactory.HELVETICA, Font.DEFAULTSIZE, Font.ITALIC))); document.add(new Paragraph("FontFactory.getFont(FontFactory.HELVETICA, Font.DEFAULTSIZE, Font.BOLD)", FontFactory.getFont(FontFactory.HELVETICA, Font.DEFAULTSIZE, Font.BOLD))); document.add( new Paragraph("FontFactory.getFont(FontFactory.HELVETICA, Font.DEFAULTSIZE, Font.BOLDITALIC)", FontFactory.getFont(FontFactory.HELVETICA, Font.DEFAULTSIZE, Font.BOLDITALIC))); document.add( new Paragraph("FontFactory.getFont(FontFactory.TIMES_ROMAN, Font.DEFAULTSIZE, Font.NORMAL)", FontFactory.getFont(FontFactory.TIMES_ROMAN, Font.DEFAULTSIZE, Font.NORMAL))); document.add( new Paragraph("FontFactory.getFont(FontFactory.TIMES_ROMAN, Font.DEFAULTSIZE, Font.ITALIC)", FontFactory.getFont(FontFactory.TIMES_ROMAN, Font.DEFAULTSIZE, Font.ITALIC))); document.add(new Paragraph("FontFactory.getFont(FontFactory.TIMES_ROMAN, Font.DEFAULTSIZE, Font.BOLD)", FontFactory.getFont(FontFactory.TIMES_ROMAN, Font.DEFAULTSIZE, Font.BOLD))); document.add( new Paragraph("FontFactory.getFont(FontFactory.TIMES_ROMAN, Font.DEFAULTSIZE, Font.BOLDITALIC)", FontFactory.getFont(FontFactory.TIMES_ROMAN, Font.DEFAULTSIZE, Font.BOLDITALIC))); document.add(new Paragraph("FontFactory.getFont(FontFactory.SYMBOL, Font.DEFAULTSIZE, Font.NORMAL)", FontFactory.getFont(FontFactory.SYMBOL, Font.DEFAULTSIZE, Font.NORMAL))); document.add( new Paragraph("FontFactory.getFont(FontFactory.ZAPFDINGBATS, Font.DEFAULTSIZE, Font.NORMAL)", FontFactory.getFont(FontFactory.ZAPFDINGBATS, Font.DEFAULTSIZE, Font.NORMAL))); } catch (Exception e) { System.err.println(e.getMessage()); } document.close(); }
From source file:com.microsoft.azure.shortcuts.services.samples.CloudServicesSample.java
public static void main(String[] args) { String publishSettingsPath = "my.publishsettings"; String subscriptionId = "9657ab5d-4a4a-4fd2-ae7a-4cd9fbd030ef"; try {//from w w w . j av a 2 s . c o m // Instantiate Azure management class final Azure azure = Azure.authenticate(publishSettingsPath, subscriptionId); test(azure); } catch (Exception e) { System.err.println(e.getMessage()); } }
From source file:G2DCircleIntersectPDF.java
public static void main(String[] args) { Document document = new Document(); try {//from w w w.java2 s.c o m PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("G2DCircleIntersectPDF.pdf")); document.open(); DefaultFontMapper mapper = new DefaultFontMapper(); FontFactory.registerDirectories(); mapper.insertDirectory("c:\\windows\\fonts"); int w = 150; int h = 150; PdfContentByte cb = writer.getDirectContent(); PdfTemplate tp = cb.createTemplate(w, h); Graphics2D g2 = tp.createGraphics(w, h, mapper); tp.setWidth(w); tp.setHeight(h); double ew = w / 2; double eh = h / 2; Ellipse2D.Double circle, circle1; circle = new Ellipse2D.Double(ew - 16, eh - 29, 50.0, 50.0); g2.setColor(Color.green); g2.fill(circle); g2.setColor(Color.red); circle1 = new Ellipse2D.Double(ew, eh, 50.0, 50.0); g2.fill(circle1); Area area1 = new Area(circle); Area area2 = new Area(circle1); g2.setColor(Color.BLUE); area1.intersect(area2); g2.fill(area1); g2.dispose(); cb.addTemplate(tp, 50, 400); } catch (Exception e) { System.err.println(e.getMessage()); } document.close(); }
From source file:dk.dren.hunspell.HunspellMain.java
public static void main(String[] args) { try {//from w ww . j a v a 2 s . co m if (args.length == 1 && args[0].equals("-libname")) { System.out.println(Hunspell.libName()); } else { System.out.println("Loading Hunspell"); File dir = new File("src/main/resources/dict"); String dirPath = dir.getCanonicalPath() + "/pt_BR"; Hunspell.Dictionary d = Hunspell.getInstance().getDictionary(dirPath); System.out.println("Hunspell library and dictionary loaded"); String words[] = { "subnutido", "isso", "nao" }; for (int i = 0; i < words.length; i++) { String word = words[i]; if (d.misspelled(word)) { List<String> suggestions = d.suggest(word); print("misspelled: " + word); if (suggestions.isEmpty()) { print("\tNo suggestions."); } else { print("\tTry:"); for (String s : suggestions) { print(" " + s); } } println(""); } else { println("ok: " + word); } } } } catch (Exception e) { log.error(e.getMessage(), e); } }
From source file:com.espad.host.Main.java
public static void main(String[] args) { try {/*from ww w .j av a2 s . co m*/ Main main = new Main(); main.run(args); } catch (Exception ex) { log.error("Unexpected exception encountered: " + ex.getMessage(), ex); } }
From source file:ListAndSublistHTML.java
public static void main(String[] args) { Document document = new Document(); try {//from w w w.ja v a 2 s. com HtmlWriter.getInstance(document, new FileOutputStream("ListAndSublistHTML.html")); document.open(); document.add(new Paragraph("Text Text Text :")); List list = new List(false, 20); list.setListSymbol(new Chunk("\u2022", FontFactory.getFont(FontFactory.HELVETICA, 20, Font.BOLD))); ListItem listItem = new ListItem("Item 1"); list.add(listItem); List sublist; sublist = new List(false, true, 10); sublist.setListSymbol(new Chunk("", FontFactory.getFont(FontFactory.HELVETICA, 8))); sublist.add("A"); sublist.add("B"); sublist.add("C"); sublist.add("D"); list.add(sublist); listItem = new ListItem("Item 2"); list.add(listItem); sublist = new List(false, true, 10); sublist.setFirst('a'); sublist.setListSymbol(new Chunk("", FontFactory.getFont(FontFactory.HELVETICA, 8))); sublist.add("A"); sublist.add("B"); sublist.add("C"); sublist.add("D"); list.add(sublist); listItem = new ListItem("Item 3"); list.add(listItem); sublist = new List(false, true, 10); sublist.setListSymbol(new Chunk("", FontFactory.getFont(FontFactory.HELVETICA, 8))); sublist.add("A"); sublist.add("B"); sublist.add("C"); sublist.add("D"); list.add(sublist); document.add(list); } catch (Exception ioe) { System.err.println(ioe.getMessage()); } document.close(); }
From source file:ListSymbolHTML.java
public static void main(String[] args) { Document document = new Document(); try {//from w w w . j av a2 s . com HtmlWriter.getInstance(document, new FileOutputStream("ListSymbolHTML.html")); document.open(); document.add(new Paragraph("Text Text Text:")); List list = new List(false, 20); list.setListSymbol(new Chunk("\u2022", FontFactory.getFont(FontFactory.HELVETICA, 20, Font.BOLD))); ListItem listItem = new ListItem("Item 1"); list.add(listItem); List sublist; sublist = new List(false, true, 10); sublist.setListSymbol(new Chunk("", FontFactory.getFont(FontFactory.HELVETICA, 8))); sublist.add("A"); sublist.add("B"); sublist.add("C"); sublist.add("D"); list.add(sublist); listItem = new ListItem("Item 2"); list.add(listItem); sublist = new List(false, true, 10); sublist.setFirst('a'); sublist.setListSymbol(new Chunk("", FontFactory.getFont(FontFactory.HELVETICA, 8))); sublist.add("A"); sublist.add("B"); sublist.add("C"); sublist.add("D"); list.add(sublist); listItem = new ListItem("Item 3"); list.add(listItem); sublist = new List(false, true, 10); sublist.setListSymbol(new Chunk("", FontFactory.getFont(FontFactory.HELVETICA, 8))); sublist.add("A"); sublist.add("B"); sublist.add("C"); sublist.add("D"); list.add(sublist); document.add(list); } catch (Exception ioe) { System.err.println(ioe.getMessage()); } document.close(); }
From source file:ListSymbolPDF.java
public static void main(String[] args) { Document document = new Document(); try {/* w w w . j a v a2 s .c o m*/ PdfWriter.getInstance(document, new FileOutputStream("ListSymbolPDF.pdf")); document.open(); document.add(new Paragraph("Text Text Text :")); List list = new List(false, 20); list.setListSymbol(new Chunk("\u2022", FontFactory.getFont(FontFactory.HELVETICA, 20, Font.BOLD))); ListItem listItem = new ListItem("Item 1"); list.add(listItem); List sublist; sublist = new List(false, true, 10); sublist.setListSymbol(new Chunk("", FontFactory.getFont(FontFactory.HELVETICA, 8))); sublist.add("A"); sublist.add("B"); sublist.add("C"); sublist.add("D"); list.add(sublist); listItem = new ListItem("Item 2"); list.add(listItem); sublist = new List(false, true, 10); sublist.setFirst('a'); sublist.setListSymbol(new Chunk("", FontFactory.getFont(FontFactory.HELVETICA, 8))); sublist.add("A"); sublist.add("B"); sublist.add("C"); sublist.add("D"); list.add(sublist); listItem = new ListItem("Item 3"); list.add(listItem); sublist = new List(false, true, 10); sublist.setListSymbol(new Chunk("", FontFactory.getFont(FontFactory.HELVETICA, 8))); sublist.add("A"); sublist.add("B"); sublist.add("C"); sublist.add("D"); list.add(sublist); document.add(list); } catch (Exception ioe) { System.err.println(ioe.getMessage()); } document.close(); }
From source file:ListAndSublistPDF.java
public static void main(String[] args) { Document document = new Document(); try {/* w w w . j a va2s . c om*/ PdfWriter.getInstance(document, new FileOutputStream("ListAndSublistPDF.pdf")); document.open(); document.add(new Paragraph("Text Text Text :")); List list = new List(false, 20); list.setListSymbol(new Chunk("\u2022", FontFactory.getFont(FontFactory.HELVETICA, 20, Font.BOLD))); ListItem listItem = new ListItem("Item 1"); list.add(listItem); List sublist; sublist = new List(false, true, 10); sublist.setListSymbol(new Chunk("", FontFactory.getFont(FontFactory.HELVETICA, 8))); sublist.add("A"); sublist.add("B"); sublist.add("C"); sublist.add("D"); list.add(sublist); listItem = new ListItem("Item 2"); list.add(listItem); sublist = new List(false, true, 10); sublist.setFirst('a'); sublist.setListSymbol(new Chunk("", FontFactory.getFont(FontFactory.HELVETICA, 8))); sublist.add("A"); sublist.add("B"); sublist.add("C"); sublist.add("D"); list.add(sublist); listItem = new ListItem("Item 3"); list.add(listItem); sublist = new List(false, true, 10); sublist.setListSymbol(new Chunk("", FontFactory.getFont(FontFactory.HELVETICA, 8))); sublist.add("A"); sublist.add("B"); sublist.add("C"); sublist.add("D"); list.add(sublist); document.add(list); } catch (Exception ioe) { System.err.println(ioe.getMessage()); } document.close(); }
From source file:ch.ledcom.jpreseed.cli.JPreseed.java
public static void main(String[] args) throws URISyntaxException, IOException { JPreseedArguments arguments = new JPreseedArguments(); try {/* w w w.j a v a2 s . c om*/ JCommander jCommander = new JCommander(arguments, args); if (arguments.isHelp()) { jCommander.usage(); System.exit(0); } arguments.validate(); initialize().create(arguments); } catch (ParameterException pe) { System.err.println(pe.getMessage()); System.exit(-1); } catch (Exception ex) { System.err.println(ex.getMessage()); System.exit(-2); } }