Example usage for java.lang System err

List of usage examples for java.lang System err

Introduction

In this page you can find the example usage for java.lang System err.

Prototype

PrintStream err

To view the source code for java.lang System err.

Click Source Link

Document

The "standard" error output stream.

Usage

From source file:CirclesPDF.java

public static void main(String[] args) {
    Document document = new Document();

    try {//  ww w. j  av a  2 s.  c  o m
        PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("CirclesPDF.pdf"));
        document.open();

        PdfContentByte cb = writer.getDirectContent();

        cb.circle(250.0f, 500.0f, 200.0f);
        cb.circle(250.0f, 500.0f, 150.0f);
        cb.circle(350.0f, 300.0f, 150.0f);
        cb.stroke();

    } catch (Exception e) {
        System.err.println(e.getMessage());
    }
    document.close();
}

From source file:FontFactoryStylesPDF.java

public static void main(String[] args) {
    Document document = new Document();

    try {//from w  ww. j  a v a 2 s  . co  m
        PdfWriter.getInstance(document, new FileOutputStream("FontFactoryStylesPDF.pdf"));
        document.open();

        FontFactory.register("c:\\windows\\fonts\\arial.ttf");
        Phrase myPhrase = new Phrase("This is font family Arial ", FontFactory.getFont("Arial", 8));
        document.add(myPhrase);
    } catch (Exception e) {
        System.err.println(e.getMessage());
    }
    document.close();
}

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 {/*w  w  w  .  j  a v a2 s.c  o m*/
        JEditorPane editorPane = new JEditorPane("http://www.java2s.com");
        editorPane.setEditable(false);
        EditorKit kit = editorPane.getEditorKit();

        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:Main.java

public static void main(final String args[]) {
    JFrame frame = new JFrame("EditorPane Example");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    try {/*  www .j a  v a  2s.  co m*/
        JEditorPane editorPane = new JEditorPane("http://www.java2s.com");
        editorPane.setEditable(false);
        String type = editorPane.getContentType();

        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:Main.java

public static void main(String[] args) {
    Path copy_from_1 = Paths.get("C:/tutorial/Java/JavaFX", "tutor.txt");

    Path copy_to_1 = Paths.get("C:/tutorial/Java/USOpen", copy_from_1.getFileName().toString());
    try {//from  w w w .  ja  va2  s  .  com
        Files.copy(copy_from_1, copy_to_1, REPLACE_EXISTING, COPY_ATTRIBUTES, NOFOLLOW_LINKS);
    } catch (IOException e) {
        System.err.println(e);
    }
}

From source file:TasteOfThingsV1.java

 public static void main(String args[]) throws Exception {
   prepareData();//from  w  w w.  java  2 s .co m

   HashBag myBag = new HashBag(testMap.values());

   System.err.println("How many Boxes? " + myBag.getCount("Boxes"));
   myBag.add("Boxes", 5);
   System.err.println("How many Boxes now? " + myBag.getCount("Boxes"));

   Method method =
     testBean.getClass().getDeclaredMethod("getTestMap", new Class[0]);
   HashMap reflectionMap =
     (HashMap)method.invoke(testBean, new Object[0]);
   System.err.println("The value of the 'squ' key using reflection: " +
     reflectionMap.get("squ"));

   String squ = BeanUtils.getMappedProperty(testBean, "testMap", "squ");
   squ = StringUtils.capitalize(squ);

   PropertyUtils.setMappedProperty(testBean, "testMap", "squ", squ);

   System.err.println("The value of the 'squ' key is: " +
     BeanUtils.getMappedProperty(testBean, "testMap", "squ"));

   String box = (String)testMap.get("box");
   String caps =
     Character.toTitleCase(box.charAt(0)) +
     box.substring(1, box.length());
   System.err.println("Capitalizing boxes by Java: " + caps);
}

From source file:Main.java

public static void main(String[] args) throws Exception {
    MaskFormatter formatter = new MaskFormatter("###-##-####");
    JFormattedTextField tf = new JFormattedTextField(formatter);
    JPanel panel = new JPanel(new BorderLayout());
    panel.add(tf, BorderLayout.NORTH);
    JButton clickBtn = new JButton("Click me!");
    clickBtn.addActionListener(e -> {
        if (!tf.getText().matches(formatter.getMask())) {
            System.err.println("Your Input does not match the pattern!");
        } else {//w ww  .j a  va 2 s .com
            System.out.println(tf.getText());
        }
    });
    panel.add(clickBtn, BorderLayout.SOUTH);
    JFrame f = new JFrame();

    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.getContentPane().add(panel, BorderLayout.CENTER);
    f.setSize(800, 600);
    f.setVisible(true);
}

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 {/*w w  w .  ja v  a2s .  co  m*/
        JEditorPane editorPane = new JEditorPane("http://www.java2s.com");
        editorPane.setEditable(false);
        Dimension dimension = editorPane.getPreferredSize();

        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:ImageSequencePDF.java

public static void main(String[] args) {
    Document document = new Document();
    try {/*from  w  w w . java2s  .c om*/
        PdfWriter.getInstance(document, new FileOutputStream("ImageSequencePDF.pdf"));
        document.open();

        Image image = Image.getInstance("logo.png");
        for (int i = 0; i < 20; i++) {
            document.add(image);
        }

    } catch (Exception e) {
        System.err.println(e.getMessage());
    }
    document.close();
}

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  w  w.java  2  s .co  m
        JEditorPane editorPane = new JEditorPane("http://www.java2s.com");
        editorPane.setEditable(false);
        boolean b = editorPane.getScrollableTracksViewportWidth();

        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);
}