List of usage examples for java.lang System err
PrintStream err
To view the source code for java.lang System err.
Click Source Link
From source file:XBMCmote.java
public static void main(String[] args) { try {// ww w. j a v a2 s . com ShellFactory.createConsoleShell("xbmc", "XBMC Control Shell v0.1.", new XBMCmote()).commandLoop(); } catch (IOException ex) { System.err.println(ex); } }
From source file:RenderingTEXT_RENDER_MODE_FILL.java
public static void main(String[] args) { Document document = new Document(); try {/*from w ww . j a v a 2 s . c o m*/ PdfWriter.getInstance(document, new FileOutputStream("RenderingTEXT_RENDER_MODE_FILL.pdf")); document.open(); Paragraph p = new Paragraph("Text Rendering:"); document.add(p); Chunk chunk = new Chunk("rendering test"); chunk.setTextRenderMode(PdfContentByte.TEXT_RENDER_MODE_FILL, 100f, new Color(0xFF, 0x00, 0x00)); document.add(chunk); } catch (Exception ioe) { System.err.println(ioe.getMessage()); } document.close(); }
From source file:MainClass.java
public static void main(String[] args) { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice screen = ge.getDefaultScreenDevice(); if (!screen.isFullScreenSupported()) { System.out.println("Full screen mode not supported"); System.exit(1);/*from w ww . j a v a 2 s . c o m*/ } try { BufferedImage loadedpic = ImageIO.read(new File("your.jpg")); screen.setFullScreenWindow(new MainClass(loadedpic)); } catch (Exception e) { System.err.println(e.getMessage()); } }
From source file:MainClass.java
public static void main(String[] args) { try {/*from ww w .ja v a 2s . c o m*/ ZipFile zf = new ZipFile("your.zip"); Enumeration e = zf.entries(); while (e.hasMoreElements()) { ZipEntry ze = (ZipEntry) e.nextElement(); String name = ze.getName(); long crc = ze.getCrc(); System.out.println("Its CRC is " + crc); String comment = ze.getComment(); if (comment != null && !comment.equals("")) { System.out.println(comment); } if (ze.isDirectory()) { System.out.println(name + " is a directory"); } } } catch (IOException ex) { System.err.println(ex); } }
From source file:Main.java
public static void main(final String args[]) { JFrame frame = new JFrame("EditorPane Example"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); try {//from w ww. j a v a2 s .com JEditorPane editorPane = new JEditorPane(new URL("http://www.java2s.com")); editorPane.setEditable(false); HyperlinkListener hyperlinkListener = new ActivatedHyperlinkListener(editorPane); editorPane.addHyperlinkListener(hyperlinkListener); JScrollPane scrollPane = new JScrollPane(editorPane); frame.add(scrollPane); } catch (IOException e) { System.err.println("Unable to load: " + e); } frame.setSize(640, 480); frame.setVisible(true); }
From source file:RenderingTEXT_RENDER_MODE_STROKE.java
public static void main(String[] args) { Document document = new Document(); try {// w ww . java 2 s. co m PdfWriter.getInstance(document, new FileOutputStream("RenderingTEXT_RENDER_MODE_STROKE.pdf")); document.open(); Paragraph p = new Paragraph("Text Rendering:"); document.add(p); Chunk chunk = new Chunk("rendering test"); chunk.setTextRenderMode(PdfContentByte.TEXT_RENDER_MODE_STROKE, 0.3f, new Color(0x00, 0x00, 0xFF)); document.add(chunk); } catch (Exception ioe) { System.err.println(ioe.getMessage()); } document.close(); }
From source file:TableCellBorderColorPDF.java
public static void main(String[] args) { Document.compress = false;//from w ww. j ava 2s.c o m Document document = new Document(); try { PdfWriter.getInstance(document, new FileOutputStream("TableCellBorderColorPDF.pdf")); document.open(); PdfPTable table = new PdfPTable(3); PdfPCell cell = new PdfPCell(); cell.addElement(new Chunk("cell ")); cell.setBorderColor(new Color(0xFF, 0x00, 0x00)); table.addCell("a cell"); table.addCell(cell); table.addCell("a cell"); document.add(table); } catch (Exception e) { System.err.println(e.getMessage()); } document.close(); }
From source file:MainClass.java
public static void main(String[] args) { String phrase = new String("www.java2s.com\n"); File aFile = new File("test.txt"); FileOutputStream outputFile = null; try {/*from w w w.j a va2 s . c om*/ outputFile = new FileOutputStream(aFile, true); System.out.println("File stream created successfully."); } catch (FileNotFoundException e) { e.printStackTrace(System.err); } FileChannel outChannel = outputFile.getChannel(); ByteBuffer buf = ByteBuffer.allocate(1024); System.out.println("New buffer: position = " + buf.position() + "\tLimit = " + buf.limit() + "\tcapacity = " + buf.capacity()); // Load the data into the buffer for (char ch : phrase.toCharArray()) { buf.putChar(ch); } System.out.println("Buffer after loading: position = " + buf.position() + "\tLimit = " + buf.limit() + "\tcapacity = " + buf.capacity()); buf.flip(); System.out.println("Buffer after flip: position = " + buf.position() + "\tLimit = " + buf.limit() + "\tcapacity = " + buf.capacity()); try { outChannel.write(buf); outputFile.close(); System.out.println("Buffer contents written to file."); } catch (IOException e) { e.printStackTrace(System.err); } }
From source file:HyphenationPDF.java
public static void main(String[] args) { Document document = new Document(PageSize.A6); try {//from w w w .jav a 2 s . c om PdfWriter.getInstance(document, new FileOutputStream("HyphenationPDF.pdf")); document.open(); String text = "\u2014"; Chunk ck = new Chunk(text); HyphenationAuto auto = new HyphenationAuto("en", "GB", 2, 2); ck.setHyphenation(auto); Paragraph p = new Paragraph(ck); p.setAlignment(Paragraph.ALIGN_JUSTIFIED); document.add(p); } catch (Exception ioe) { System.err.println(ioe.getMessage()); } document.close(); }
From source file:RenderingTEXT_RENDER_MODE_FILL_STROKE.java
public static void main(String[] args) { Document document = new Document(); try {/* w w w. j a va 2s . co m*/ PdfWriter.getInstance(document, new FileOutputStream("RenderingTEXT_RENDER_MODE_FILL_STROKE.pdf")); document.open(); Paragraph p = new Paragraph("Text Rendering:"); document.add(p); Chunk chunk = new Chunk("rendering test"); chunk.setTextRenderMode(PdfContentByte.TEXT_RENDER_MODE_FILL_STROKE, 100f, new Color(0xFF, 0x00, 0x00)); document.add(chunk); } catch (Exception ioe) { System.err.println(ioe.getMessage()); } document.close(); }