Is JavaFX built on top of Java 3D graphics?

Hi
I just wrote couple of JavaFX programs. And the thing that striked me was that the scene graph seemed similar to Java 3D API.
Is JavaFX built on top of Java 3D?
Thanks

AFAIK, no, although somebody made sketches using Java 3D within JavaFX (using binding).
The scene graph, which might be inspired from Java 3D, but also other projects, comes from the [scenegraph project|https://scenegraph.dev.java.net/] (although it probably have evolved from that since then).

Similar Messages

  • JavaFX hangs when called from Java

    Hello
    I am developing a java application with a JavaFX gui, the communication from Java works with an java interface. The communication works,but after a few updates the javaFX code hangs and subsequently the Java code also hangs.
    Is this a common problem, and so is there a common solution for this.

    JavaFX UI calls need to be done on the Event Thread. So if your Java Application has multiple threads or runs on a different Thread to need to wrap all callbacks to JavaFX in a deferAction like this:
    class YourFXClass extends YourJavaInterface {
       override public function someMethod(someArgument) {
            FX.deferAction(function() : Void {
                  // doSomething with someArgument
        }

  • JAVA Drawing Graphics Save as JPEG?

    My problem is this, I am trying to save my g2 graphic image to a jpg. This is how I have things setup, I will show code and my thoughts. What I need is help to figure out how I could save seperate .java files graphics g to the jpg format from a JFileChooser in a different .java file.
    HERE IS THE CODE FOR HOW GRAPH IS CREATED. graph.java
    I have a graph I am drawing in a seperate .java file and it is created like this:
    public class graph extends JPanel {
        public static Graphics2D g2;
        final int HPAD = 60, VPAD = 40;
        int[] data;
        Font font;
        public test() {
            data = new int[] {120, 190, 211, 75, 30, 290, 182, 65, 85, 120, 100, 101};
            font = new Font("lucida sans regular", Font.PLAIN, 8);       
            setBackground(Color.white);
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            g2.setFont(font);
            FontRenderContext frc = g2.getFontRenderContext();
            int w = getWidth();
            int h = getHeight();
            // scales
            float xInc = (w - HPAD - HPAD) / 10f;
            float yInc = (h - 2*VPAD) / 10f;
            int[] dataVals = getDataVals();
            float yScale = dataVals[2] / 10f;
    //        etc... (the rest is just drawing...blah...blah)
    }HERE IS THE CODE FOR HOW MY GRAPH IS DISPLAYED AND TRYING TO BE SAVED. results.java
    The graph I created is then displayed in a JPanel and there is a button in the results window to save the graph results. This is where I am having difficulty as I am trying to save the g2 from graph.java (declared public static...not sure if this a good idea) but anyway I want to save this as a jpg heres the code:
            resultPanel = new JPanel(new PercentLayout());
            graph drawing = new graph();
            resultPanel.add (
                drawing,
                new PercentLayout.Constraint(1,41,49,50));
            resultPanel.add (
                saveButton1,
                new PercentLayout.Constraint(1,94,25,5));
        public void actionPerformed(ActionEvent e) {
            if(e.getSource() == saveButton1) {
                doSaveGraph();
        public void doSaveGraph() {
            JFileChooser fileSaver;
            fileSaver = new JFileChooser(); // The file-opening dialog
            ExampleFileFilter filter = new ExampleFileFilter("jpg");
            filter.setDescription("JPEG Picture File");
            fileSaver.addChoosableFileFilter(filter);
            try {
                if(fileSaver.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) {
                    File f = fileSaver.getSelectedFile();
                    BufferedImage img = new BufferedImage(672,600, BufferedImage.TYPE_INT_RGB);
          // SOMEWHERE IN HERE IS WHERE I NEED TO GRAB G2?  I AM NOT SURE WHAT TO DO HERE
                    //Graphics g = img.getGraphics();
                    //panel.paint(g);
                    BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(f));
                    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
                    JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(img);
                    param.setQuality(1f, true);
                    encoder.setJPEGEncodeParam(param);
                    encoder.encode(img);
                    System.out.println("It worked");
                else{}
            catch (Exception e) {
                e.printStackTrace();
    ...If you can help me I will be very happy, and give you 10 dukes! LOL and I appreciate the help!

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.font.*;
    import java.awt.geom.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    public class SavingGraphics
        public static void main(String[] args)
            GraphicsCreationPanel graphicsPanel = new GraphicsCreationPanel();
            GraphicsSaver saver = new GraphicsSaver(graphicsPanel);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(saver.getUIPanel(), "North");
            f.getContentPane().add(graphicsPanel);
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    class GraphicsCreationPanel extends JPanel
        String text;
        Font font;
        public GraphicsCreationPanel()
            text = "hello world";
            font = new Font("lucida bright regular", Font.PLAIN, 36);
            setBackground(Color.white);
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            int w = getWidth();
            int h = getHeight();
            g2.setPaint(Color.blue);
            g2.draw(new Rectangle2D.Double(w/16, h/16, w*7/8, h*7/8));
            g2.setPaint(Color.orange);
            g2.fill(new Ellipse2D.Double(w/12, h/12, w*5/6, h*5/6));
            g2.setPaint(Color.red);
            g2.fill(new Ellipse2D.Double(w/6, h/6, w*2/3, h*2/3));
            g2.setPaint(Color.black);
            g2.setFont(font);
            FontRenderContext frc = g2.getFontRenderContext();
            LineMetrics lm = font.getLineMetrics(text, frc);
            float textWidth = (float)font.getStringBounds(text, frc).getWidth();
            float x = (w - textWidth)/2;
            float y = (h + lm.getHeight())/2 - lm.getDescent();
            g2.drawString(text, x, y);
    class GraphicsSaver
        GraphicsCreationPanel graphicsPanel;
        JFileChooser fileChooser;
        public GraphicsSaver(GraphicsCreationPanel gcp)
            graphicsPanel = gcp;
            fileChooser = new JFileChooser(".");
        private void save()
            if(fileChooser.showSaveDialog(null) == JFileChooser.APPROVE_OPTION)
                File file = fileChooser.getSelectedFile();
                String ext = file.getPath().substring(file.getPath().indexOf(".") + 1);
                BufferedImage image = getImage();
                try
                    ImageIO.write(image, ext, file);
                catch(IOException ioe)
                    System.out.println("write: " + ioe.getMessage());
        private BufferedImage getImage()
            int w = graphicsPanel.getWidth();
            int h = graphicsPanel.getHeight();
            BufferedImage bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
            Graphics2D g2 = bi.createGraphics();
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            graphicsPanel.paint(g2);
            g2.dispose();
            return bi;
        public JPanel getUIPanel()
            JButton save = new JButton("save");
            save.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    save();
            JPanel panel = new JPanel();
            panel.add(save);
            return panel;
    }

  • When to Use XSLT,Java or Graphical Mapping

    Hi Friends,
       Could any one please give me a clear picture on when to use Java/XSLT/Graphical Mappings. Which mapping should be used in which case.
    Regards,
    Shyam

    Hi
       Plz check the below links for your answer..
    Java Mapping : http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/content.htm
    XSLT mapping : http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/content.htm
    Message mapping:
    http://help.sap.com/saphelp_nw04/helpdata/en/ee/bf9640dc522f28e10000000a1550b0/content.htm
    Regards
    Su

  • Cannot resolve symbol java.awt.graphics

    // DrawRectangleDemo.java
    import java.awt.*;
    import java.lang.Object;
    import java.applet.Applet;
    public class DrawRectangleDemo extends Applet
         public void paint (Graphics g)
              // Get the height and width of the applet's drawing surface.
              int width = getSize ().width;
              int height = getSize ().height;
              int rectWidth = (width-50)/3;
              int rectHeight = (height-70)/2;
              int x = 5;
              int y = 5;
              g.drawRect (x, y, rectWidth, rectHeight);
              g.drawString ("drawRect", x, rectHeight + 30);
              x += rectWidth + 20;
              g.fillRect (x, y, rectWidth, rectHeight);
              // Calculate a border area with each side equal tp 25% of
              // the rectangle's width.
              int border = (int) (rectWidth * 0.25);
              // Clear 50% of the filled rectangle.
              g.clearRect (x + border, y + border,
                             rectWidth - 2 * border, rectHeight - 2 * border);
              g.drawString ("fillRect/clearRect", x, rectHeight + 30);
              x += rectWidth + 20;
              g.drawRoundRect (x, y, rectWidth, rectHeight, 15, 15);
              g.drawString ("drawRoundRect", x, rectHeight + 30);
              x=5;
              y += rectHeight + 40;
              g.setColor (Color.yellow);
              for (int i = 0; i < 4; i++)
                   g.draw3DRect (x + i * 2, y + i * 2,
                                       rectWidth - i * 4, rectHeight - i * 4, false);
              g.setColor (Color.black);
              g.drawString ("draw3DRect", x, y, + rectHeight + 25);
              x += rectWidth + 20;
              g.setColor (Color.yellow);
              g.fill3DRect (x, y, rectWidth, rectHeight, true);
              g.setColor (Color.black);
              g.drawString ("fill3DRect", x, y, + rectHeight + 25);
    Help me with this codes. I typed correctly but there still errors.
    --------------------Configuration: JDK version 1.3.1 <Default>--------------------
    D:\Program Files\Xinox Software\JCreator LE\MyProjects\DrawRectangleDemo.java:56: cannot resolve symbol
    symbol : method drawString (java.lang.String,int,int,int)
    location: class java.awt.Graphics
              g.drawString ("draw3DRect", x, y, + rectHeight + 25);
    ^
    D:\Program Files\Xinox Software\JCreator LE\MyProjects\DrawRectangleDemo.java:64: cannot resolve symbol
    symbol : method drawString (java.lang.String,int,int,int)
    location: class java.awt.Graphics
              g.drawString ("fill3DRect", x, y, + rectHeight + 25);
    ^
    2 errors
    Process completed.
    -------------------------------------------------------------------------------------------------------------------------------

    cannot resolve symbol
    symbol : method drawString (java.lang.String,int,int,int)
    This is telling you that you are trying to invoke the drawString() method with 4 parameters: String, int, int, int
    If you look at the API the drawString() method need 3 parameters: String, int, int - so you have an extra int
    location: class java.awt.Graphics
    g.drawString ("draw3DRect", x, y, + rectHeight + 25);
    Now is you look at your code you will find that you have 3 ',' in you method call. (I don't think you want the ',' after the y.

  • CDR-17066 RON cannot find java EWT graphics classes

    Hello,
    I am evaluating Oracle SCM. Everything's going great, except I am unable to use the Version History or Version Events. When I try, I get an error:
    "CDR-17066: RON cannot find java EWT graphics classes"
    The action it recommends is to check the registry or environment variable JVM_CLASSPATH_RON, and make sure it points to the ewt jar.
    I found a jar called ewt3.jar in my oracle/jlib directory. There was no environmental variable called JVM_CLASSPATH_RON, so I created one and set it to that jar. But I'm still getting the same error.
    Any help would be appreciated. Thank you.

    Hi,
    this error message is rather strange: I checked in our knwoledge base, but you seem to be the first one having this issue!
    I had a look to my registry and indeed I couldn't find the variable JVM_CLASSPATH_RON.
    I suspect that this variable was superseded by another one (JVM_CLASSPATH_DEFAULT_THIN_JDBC ?).
    I checked for all variables including ewt and found the following:
    . FORMS90_CLASSPATH (<Home>\jlib\ewt3.jar)
    . FORMS90_BUILDER_CLASSPATH (<Home>\jlib\ewt3.jar)
    . JVM_CLASSPATH_DEFAULT_THIN_JDBC (<Home>\jlib\ewt4.jar)
    FORMS90_... variables are not used by the Version History and Version Event Viewers, but JVM_CLASSPATH_DEFAULT_THIN_JDBC is.
    I removed the entry <Home>\jlib\ewt4.jar from JVM_CLASSPATH_DEFAULT_THIN_JDBC, and then I could reproduce your issue.
    So could you check the content of this variable JVM_CLASSPATH_DEFAULT_THIN_JDBC?
    It's located in HKEY_LOCAL_MACHINE\SOFTWARE\Oracle\HOMEx\REPADM61\DEFAULT_JVM_PARAMS_THIN_JDBC
    Could you also check that file <Home>\jlib\ewt4.jar does exist on your machine?
    Regards,
    Didier.

  • Adding java 2d graphices to a JScrollPane

    How can I use the graphics 2d in a Java Applet JScrollPane?
    here is me code. I have a a ImageOps.java file that does a bunch of Java 2d, but I need it to fit into my applet's JScrollPane. Can anyone help me?
    package louis.tutorial;
    import java.awt.BorderLayout;
    import javax.swing.JPanel;
    import javax.swing.JApplet;
    import java.awt.Dimension;
    import javax.swing.JInternalFrame;
    import javax.swing.JButton;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.GridBagLayout;
    import java.awt.GridBagConstraints;
    import java.awt.FlowLayout;
    import java.awt.GridLayout;
    import java.awt.Image;
    import java.awt.MediaTracker;
    import java.awt.Rectangle;
    import java.awt.Point;
    import javax.swing.JComboBox;
    import javax.swing.JList;
    import javax.swing.JTextArea;
    import javax.imageio.ImageIO;
    import javax.swing.Icon;
    import javax.swing.JFrame;
    import javax.swing.JMenu;
    import javax.swing.JMenuBar;
    import javax.swing.JLabel;
    import javax.swing.JMenuItem;
    import javax.swing.ImageIcon;
    import javax.swing.KeyStroke;
    import java.awt.FileDialog;
    import java.awt.Toolkit;
    import java.awt.Color;
    import java.awt.image.BufferedImage;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import java.awt.event.KeyEvent;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.io.File;
    import java.io.IOException;
    import java.net.URL;
    import javax.swing.JScrollPane;
    * Place class description here
    * @version 1.0
    * @author llakser
    public class ImageApplet extends JApplet {
    private JPanel jContentPane = null;
    private JPanel jpLower = null;
    private JButton JBFirst = null;
    private JButton JBPrevious = null;
    private JButton JBNext = null;
    private JButton JBLast = null;
    private JButton JBZoonIn = null;
    private JButton JBZoomOut = null;
    private JButton JBAnimate = null;
    private JButton JBPause = null;
    private JButton JBAutoRepeat = null;
    private JComboBox jcbFrameDelay = null;
    private BufferedImage image; // the rasterized image
    private Image[] numbers = new Image[10];
    private Thread animate;
    private MediaTracker tracker;
    private int frame = 0;
    private ImageIcon[] icon = null;
    private JFrame f = new JFrame("ImageOps");
    * This is the xxx default constructor
    public ImageApplet() {
         super();
    * This method initializes this
    * @return void
    public void init() {
         this.setSize(600, 600);
         this.setContentPane(getJContentPane());
         this.setName("");
         this.setMinimumSize(new Dimension(600, 600));
         this.setPreferredSize(new Dimension(600, 600));
    // f.addWindowListener(new WindowAdapter() {
    // public void windowClosing(WindowEvent e) {System.exit(0);}
    ImageOps applet = new ImageOps();
    //getJContentPane().add("Center", f);
    getJContentPane().add("Center", applet);
    //applet.add(f);
    applet.init();
    f.pack();
    f.setSize(new Dimension(550,550));
    f.setVisible(true);
    public void load() {
         tracker = new MediaTracker(this);
         for (int i = 1; i < 10; i++) {
         numbers[i] = getImage (getCodeBase (), i+".jpeg");//getImage(getDocumentBase(), "Res/" + i + ".gif");
         //Image img;
         //ico[i] = new ImageIcon(getCodeBase (), i+".jpeg");
         /* if (fInBrowser)
         img = getImage (getCodeBase (), "1.jpeg");
         else
         img = Toolkit.getDefaultToolkit ().getImage (
         "1.jpeg");*/
         tracker.addImage(numbers, i);
         try {
         tracker.waitForAll();
         } catch (InterruptedException e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
         int i = 1;
         // for (int i = 1; i < 10; i++)
              icon[0] = new ImageIcon ("C:/images2/1.jpeg");//getImage(getDocumentBase(), "Res/" + i + ".gif");
              //icon[0] = new ImageIcon("C:/images2/1.jpg");
              //System.out.println("Made it after icon " + ico.toString());
              //ImageIcon ii = new ImageIcon("1.jpg");
              //jLabel = new JLabel(icon);
              //jLabel.setText("JLabel");
              //jLabel.setIcon(icon[0]);
         Graphics g = null;
              //g.drawImage(numbers[1],0,0,1500,1400,jScrollPane);
         //ImageIcon ii = new ImageIcon(numbers[2]);
         //this.jScrollPane.add(new JLabel(ii));// = new JScrollPane(new JLabel(ii));
         // System.out.println("Gee I made it..");
              //scroll.paintComponents(g);
              //paintComponents(g);
    public void paintComponents(Graphics g) {
    super.paintComponents(g);
    // Retrieve the graphics context; this object is used to paint shapes
    Graphics2D g2d = (Graphics2D)g;
    // Draw an oval that fills the window
    int width = this.getBounds().width;
    int height = this.getBounds().height;
    Icon icon = new ImageIcon("C:/images2/1.jpg");
    //jLabel.setIcon(icon);
    //g2d.drawImage(0,0,1500,1400);
    g2d.drawOval(10,20, 300,400);
    // and Draw a diagonal line that fills MyPanel
    g2d.drawLine(0,0,width,height);
    * This method initializes jContentPane
    * @return javax.swing.JPanel
    private JPanel getJContentPane() {
         if (jContentPane == null) {
         jContentPane = new JPanel();
         jContentPane.setLayout(new BorderLayout());
         jContentPane.setPreferredSize(new Dimension(768, 576));
         jContentPane.setMinimumSize(new Dimension(768, 576));
         jContentPane.setName("");
         jContentPane.add(getJpLower(), BorderLayout.SOUTH);
         return jContentPane;
    * This method initializes jpLower     
    * @return javax.swing.JPanel     
    private JPanel getJpLower() {
    if (jpLower == null) {
         try {
         jpLower = new JPanel();
         jpLower.setLayout(null);
         jpLower.setPreferredSize(new Dimension(500, 100));
         jpLower.setMinimumSize(new Dimension(500, 160));
         jpLower.add(getJBFirst(), null);
         jpLower.add(getJBPrevious(), null);
         jpLower.add(getJBNext(), null);
         jpLower.add(getJBLast(), null);
         jpLower.add(getJBZoonIn(), null);
         jpLower.add(getJBZoomOut(), null);
         jpLower.add(getJBAnimate(), null);
         jpLower.add(getJBPause(), null);
         jpLower.add(getJBAutoRepeat(), null);
         jpLower.add(getJcbFrameDelay(), null);
         } catch (java.lang.Throwable e) {
         // TODO: Something
    return jpLower;
    * This method initializes JBFirst     
    * @return javax.swing.JButton     
    private JButton getJBFirst() {
    if (JBFirst == null) {
         try {
         JBFirst = new JButton();
         JBFirst.setText("First");
         JBFirst.setLocation(new Point(7, 7));
         JBFirst.setSize(new Dimension(59, 26));
         JBFirst.addActionListener(new java.awt.event.ActionListener() {
         public void actionPerformed(java.awt.event.ActionEvent e) {
              System.out.println("First Button Clicked()");
         load();
              // TODO Auto-generated Event stub actionPerformed()
         } catch (java.lang.Throwable e) {
         // TODO: Something
    return JBFirst;
    * This method initializes JBPrevious     
    * @return javax.swing.JButton     
    private JButton getJBPrevious() {
    if (JBPrevious == null) {
         try {
         JBPrevious = new JButton();
         JBPrevious.setText("Previous");
         JBPrevious.setLocation(new Point(69, 7));
         JBPrevious.setSize(new Dimension(94, 26));
         } catch (java.lang.Throwable e) {
         // TODO: Something
    return JBPrevious;
    * This method initializes JBNext     
    * @return javax.swing.JButton     
    private JButton getJBNext() {
    if (JBNext == null) {
         try {
         JBNext = new JButton();
         JBNext.setText("Next");
         JBNext.setLocation(new Point(166, 7));
         JBNext.setSize(new Dimension(66, 26));
         } catch (java.lang.Throwable e) {
         // TODO: Something
    return JBNext;
    * This method initializes JBLast     
    * @return javax.swing.JButton     
    private JButton getJBLast() {
    if (JBLast == null) {
         try {
         JBLast = new JButton();
         JBLast.setText("Last");
         JBLast.setLocation(new Point(235, 7));
         JBLast.setSize(new Dimension(59, 26));
         } catch (java.lang.Throwable e) {
         // TODO: Something
    return JBLast;
    * This method initializes JBZoonIn     
    * @return javax.swing.JButton     
    private JButton getJBZoonIn() {
    if (JBZoonIn == null) {
         try {
         JBZoonIn = new JButton();
         JBZoonIn.setText("Zoom In");
         JBZoonIn.setLocation(new Point(408, 7));
         JBZoonIn.setPreferredSize(new Dimension(90, 26));
         JBZoonIn.setSize(new Dimension(90, 26));
         } catch (java.lang.Throwable e) {
         // TODO: Something
    return JBZoonIn;
    * This method initializes JBZoomOut     
    * @return javax.swing.JButton     
    private JButton getJBZoomOut() {
    if (JBZoomOut == null) {
         try {
         JBZoomOut = new JButton();
         JBZoomOut.setBounds(new Rectangle(503, 7, 90, 26));
         JBZoomOut.setPreferredSize(new Dimension(90, 26));
         JBZoomOut.setText("Zoom Out");
         } catch (java.lang.Throwable e) {
         // TODO: Something
    return JBZoomOut;
    * This method initializes JBAnimate     
    * @return javax.swing.JButton     
    private JButton getJBAnimate() {
    if (JBAnimate == null) {
         try {
         JBAnimate = new JButton();
         JBAnimate.setText("Animate");
         JBAnimate.setSize(new Dimension(90, 26));
         JBAnimate.setPreferredSize(new Dimension(90, 26));
         JBAnimate.setLocation(new Point(408, 36));
         } catch (java.lang.Throwable e) {
         // TODO: Something
    return JBAnimate;
    * This method initializes JBPause     
    * @return javax.swing.JButton     
    private JButton getJBPause() {
    if (JBPause == null) {
         try {
         JBPause = new JButton();
         JBPause.setPreferredSize(new Dimension(90, 26));
         JBPause.setLocation(new Point(503, 36));
         JBPause.setSize(new Dimension(90, 26));
         JBPause.setText("Pause");
         } catch (java.lang.Throwable e) {
         // TODO: Something
    return JBPause;
    * This method initializes JBAutoRepeat     
    * @return javax.swing.JButton     
    private JButton getJBAutoRepeat() {
    if (JBAutoRepeat == null) {
         try {
         JBAutoRepeat = new JButton();
         JBAutoRepeat.setBounds(new Rectangle(446, 65, 106, 26));
         JBAutoRepeat.setText("Auto Repeat");
         } catch (java.lang.Throwable e) {
         // TODO: Something
    return JBAutoRepeat;
    * This method initializes jcbFrameDelay     
    * @return javax.swing.JComboBox     
    private JComboBox getJcbFrameDelay() {
    if (jcbFrameDelay == null) {
         try {
         jcbFrameDelay = new JComboBox();
         jcbFrameDelay.setSize(new Dimension(156, 25));
         jcbFrameDelay.setName("Frame Delay");
         jcbFrameDelay.setLocation(new Point(7, 35));
         } catch (java.lang.Throwable e) {
         // TODO: Something
    return jcbFrameDelay;
    } // @jve:decl-index=0:visual-constraint="10,10"

    I think you've got it:
    public class ImageComponent extends JPanel { //or JComponent
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            //do your rendering here
    }The fact that ImageComponent sits inside JScrollPane is accidental, right?
    It should be able to function on its own, without a JScrollPane present, just as JTextArea can.
    So I'm not sure what your question is. Can you post a small (<1 page)
    example program demonstrating your problem.
    For example, here are a very few lines demonstrating what I am trying to say:
    import java.awt.*;
    import javax.swing.*;
    class CustomExample extends JPanel {
        public CustomExample() {
            setPreferredSize(new Dimension(800,800));
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            g.fillOval(0, 0, getWidth(), getHeight());
        public static void main(String[] args) {
            EventQueue.invokeLater(new Runnable(){
                public void run() {
                    JFrame f = new JFrame("CustomExample");
                    f.getContentPane().add(new JScrollPane(new CustomExample()));
                    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                    f.setSize(400,400);
                    f.setLocationRelativeTo(null);
                    f.setVisible(true);
    }Now you post your problem in a program that is just as short.

  • Java 2D graphics help

    Hi, i need 2 files, Index class file(JFrame) and a Draw.class file
    Basically, i have a button in the index jframe form, and when i clicked on the button, there will be a JPanel/ Applet pop up, with a circle in it. can any1 write me some sample codes? a simple one will do. Thanks

    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.BasicStroke;
    import java.awt.GradientPaint;
    import java.awt.TexturePaint;
    import java.awt.Rectangle;
    import java.awt.Graphics2D;
    import java.awt.geom.Ellipse2D;
    import java.awt.geom.Rectangle2D;
    import java.awt.geom.RoundRectangle2D;
    import java.awt.geom.Arc2D;
    import java.awt.geom.Line2D;
    import java.awt.image.BufferedImage;
    import javax.swing.JPanel;
    public class ShapesJPanel extends JPanel
       // draw shapes with Java 2D API
       public void paintComponent( Graphics g )
          super.paintComponent( g ); // call superclass's paintComponent
          Graphics2D g2d = ( Graphics2D ) g; // cast g to Graphics2D
          // draw 2D ellipse filled with a blue-yellow gradient
          g2d.setPaint( new GradientPaint( 5, 30, Color.BLUE, 35, 100,
             Color.YELLOW, true ) ); 
          g2d.fill( new Ellipse2D.Double( 5, 30, 65, 100 ) );
          // draw 2D rectangle in red
          g2d.setPaint( Color.RED );                 
          g2d.setStroke( new BasicStroke( 10.0f ) );
          g2d.draw( new Rectangle2D.Double( 80, 30, 65, 100 ) );
          // draw 2D rounded rectangle with a buffered background
          BufferedImage buffImage = new BufferedImage( 10, 10,
             BufferedImage.TYPE_INT_RGB );
          // obtain Graphics2D from bufferImage and draw on it
          Graphics2D gg = buffImage.createGraphics();  
          gg.setColor( Color.YELLOW ); // draw in yellow
          gg.fillRect( 0, 0, 10, 10 ); // draw a filled rectangle
          gg.setColor( Color.BLACK );  // draw in black
          gg.drawRect( 1, 1, 6, 6 ); // draw a rectangle
          gg.setColor( Color.BLUE ); // draw in blue
          gg.fillRect( 1, 1, 3, 3 ); // draw a filled rectangle
          gg.setColor( Color.RED ); // draw in red
          gg.fillRect( 4, 4, 3, 3 ); // draw a filled rectangle
          // paint buffImage onto the JFrame
          g2d.setPaint( new TexturePaint( buffImage,
             new Rectangle( 10, 10 ) ) );
          g2d.fill(
             new RoundRectangle2D.Double( 155, 30, 75, 100, 50, 50 ) );
          // draw 2D pie-shaped arc in white
          g2d.setPaint( Color.WHITE );
          g2d.setStroke( new BasicStroke( 6.0f ) );
          g2d.draw(
             new Arc2D.Double( 240, 30, 75, 100, 0, 270, Arc2D.PIE ) );
          // draw 2D lines in green and yellow
          g2d.setPaint( Color.GREEN );
          g2d.draw( new Line2D.Double( 395, 30, 320, 150 ) );
          // draw 2D line using stroke
          float dashes[] = { 10 }; // specify dash pattern
          g2d.setPaint( Color.YELLOW );   
          g2d.setStroke( new BasicStroke( 4, BasicStroke.CAP_ROUND,
             BasicStroke.JOIN_ROUND, 10, dashes, 0 ) );
          g2d.draw( new Line2D.Double( 320, 30, 395, 150 ) );
       } // end method paintComponent
    } // end class ShapesJPanelbasically.. when i click on a button in the index class file, it will call this class file, i do not know to code to call this class file.
    Edited by: slaydragon on Nov 11, 2007 10:55 AM

  • Migrating a custom built BusinessObjects 6.5 Java application to XI 3.1

    Hi,
    We have a Business Objects 6.5 system which needs to be migrated to XI 3.1.
    In the present Business Objects 6.5 system, we have a custom built Java application deployed on WebLogic. Its got a single sign on also configured from the Java web page into InfoView. A fair deal of SDK customization has been done to achieve this.
    My question is, if we need to set up the same portal to function similarly in Business Objects XI 3.1, what are the steps to be followed? Should the code be re-written to adhere to the XI 3.1 SDK and then re-deployed on the new server? Kindly correct me if I'm wrong.
    I found this document: u201CMigrating Business Objects 6 Customized Applications to BusinessObjects Enterprise XI R2u201D which provides info on this. But, Iu2019m not yet able to figure out where to begin.
    I do not have great exposure to writing code and deploying web applications. So Iu2019ll be very grateful for any help and pointers on this.
    Many thanks!
    Rahul

    More than likely it will need to be a complete rewrite.
    At the top of this forum there is a post called [Read Before Posting - Where to find Business Objects Java SDK Resources|Read Before Posting - Where to find Business Objects Java SDK Resources; which you should read.
    It has links to various Java SDK information and samples.
    I would suggest starting there.
    Jason

  • LDAP user authentication on EP6 built on NW04 abap+java

    Hello,
    Our customer insisted we install is EP6 system as a ABAPJAVA system. He asked that users login to the portal will be authenticated (username password) from their directory service via LDAP. Because the EP6 is built on a ABAPJAVA, and not only JAVA, I cannot use the portal or visual adiministrator tools to make the LDAP be the source User Management system.
    I have been looking all day in the sap online help and I do not see any instructions on how to configure user+password logon authentication via LDAP on an ABAP based UME system. The most I have managed was to setup the connection from the EP6 system to ldap via transaction LDAP and bring up the ldap connector.
    I need to know how to proceed from here.
    Thanks
    Boaz

    Hello,
    I add a notion that this configuration is not supported.
    However, please look at the following link, which relates to an ABAP system, I refer to the bolded section.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/aa/a17941601b050de10000000a1550b0/frameset.htm
    The following is mentioned in this link:
    The user password is not transferred from the SAP Web AS to the LDAP directory during the synchronization of the user data. You must therefore maintain the user password with one of the following options:
    You specify the passwords centrally in the LDAP server. The users must log on using the UME, are authenticated with the LDAP server, receive a logon ticket and can then access all systems with Single Sign-On. In this case, all systems must be configured so that they accept logon tickets.
    ·        You specify the passwords in a decentralized way, both in the CUA and in the LDAP directory (or in the UME). In this case, the CUA systems do not need to accept logon tickets.
    What is the meaning behind this?
    Thanks
    Boaz

  • Printer Built-in fonts in java

    Hello,
    I'm using Imaje 2000 Series Printer, when opening a new microsoft word document I can see some built in fonts specific to that printer like Imaje Arial, Imaje Times New Roman B, etc... I found out when printing with one of these fonts, the printing process is very fast. what happens is that I can see those fonts with name Imaje in MS word with printer icon attached to them, but in java i cant see them, and to check all fonts in java i used the below code :
    Font[] f = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
    for (int i=0; i<f.length; i++) {
    System.out.println(f.getFontName());
    if i try to set the font to Imaje Arial, java will neglect that font and print on the default I guess. Is there a way to use the printer built in fonts from within my java application

    well, i cant find the font in windows fonts
    directory, but when I open MS wrod i can find the
    font (for example: Imaje Arial) in the fonts list and
    has an icon of printer which means its not a true
    type font. and please note that this font Imaje Arial
    did not appear in MS word before installing the
    printer driver.Well, if it's not installed and you can't find the file, how do you expect Java to do it?

  • Cannot reach com.sun.javafx.runtime.sequence package from Java

    Hello!
    I'm trying to create JavaFX sequence from Java code, because creating sequences with large amount of data (more than 10000 elements) seems to be quite inefficient in JavaFX (leastwise takes almost a minute(!) when using insert ... into ...).
    The problem is that I get the following error message when trying to use SequenceBuilder from Java:
    {color:#ff0000}+Compiling 1 source file to C:\Users\&Aacute;kos\Documents\NetBeansProjects2\PolylineProba\build\classes+
    C:\Users\&Aacute;kos\Documents\NetBeansProjects2\PolylineProba\src\polylineproba\ArrayBuilder.java:11: package com.sun.javafx.runtime.sequence does not exist
    import com.sun.javafx.runtime.sequence.*;
    +1 error+{color}
    The sample code is very simple:
    {color:#333399}+package test;+
    import com.sun.javafx.runtime.sequence.*;
    +public class ArrayBuilder {+
    +}+{color}
    This is strange as the code completion sees all classes inside the mentioned package, but the compiler doesn't.
    Does anyone have an idea, why? (I'm using Netbeans 6.1 with JavaFX SDK preview 1.0.)
    Thanks,
    Akos

    Hello!
    Normally you don't need to know the exact location of these files as you can add them to the project by adding a library. To do this in Netbeans: right click on the Libraries in the project tree and choose Add library. Then you should see JavaFXUserLib.
    If not then find and add them manually to the classpath:
    javafx-sdk1.0pre1/lib/Decora-D3D.jar
    javafx-sdk1.0pre1/lib/Decora-HW.jar
    javafx-sdk1.0pre1/lib/Decora-OGL.jar
    javafx-sdk1.0pre1/lib/Scenario.jar
    javafx-sdk1.0pre1/lib/gluegen-rt.jar
    javafx-sdk1.0pre1/lib/javafx-swing.jar
    javafx-sdk1.0pre1/lib/javafxc.jar
    javafx-sdk1.0pre1/lib/javafxdoc.jar
    javafx-sdk1.0pre1/lib/javafxgui.jar
    javafx-sdk1.0pre1/lib/javafxrt.jar
    javafx-sdk1.0pre1/lib/jmc.jar
    javafx-sdk1.0pre1/lib/jogl.jar
    Good luck

  • #! /bin/ksh at top of java relatd scripts in ORACLE_HOME/bin

    Hey, Oracle, you have references to the Korn shell at the
    beginning of many of the script files in $ORACLE_HOME/bin, but I
    don't recall seeing anywhere in the installation documentation
    that you require the Korn shell!!!!!
    -Jon
    Example problem script file beginning:
    #!/bin/ksh
    # vbjc
    Listing of related scripts:
    [oracle@d185fc6b6 bin]$ cd $ORACLE_HOME/bin
    [oracle@d185fc6b6 bin]$ file * | grep Korn
    deployejb: Korn shell script text
    dropjava: Korn shell script text
    ejbdescriptor: Korn shell script text
    gatekeeper: Korn shell script text
    idl2ir: Korn shell script text
    idl2java: Korn shell script text
    irep: Korn shell script text
    java2idl: Korn shell script text
    java2iiop: Korn shell script text
    java2rmi_iiop: Korn shell script text
    loadjava: Korn shell script text
    modifyprops: Korn shell script text
    oadj: Korn shell script text
    oadutil: Korn shell script text
    publish: Korn shell script text
    remove: Korn shell script text
    vbdebug: Korn shell script text
    vbj: Korn shell script text
    vbjc: Korn shell script text
    null

    Hi Luz,
    All services were stopped,
    Windows services and OPMN.
    Thanks,
    Gavin

  • Top Sites/Cover Flow Graphical Problem - Still unresolved :(

    Since I updated to Safari 4, I have been unable to use the browser effectively due to an error I can't resolve. Hopefully you guys can help!
    Whenever I view the Top Sites page. It initially loads a plain black screen with the text along the bottom. No placeholders for the top sites are in place and no previews. Now, If I click OFF the window, onto the desktop background for example, all the content loads in (placeholder top site previews for example) basically meaning if i want to use this functionality I need to constantly click off and onto the safari window. Also moving over the interface after the placeholder or top site previews load in doesn't do anything. To get any of the animation to play I need to constantly click off and onto the window.
    The same thing happens when using Cover flow to browse history. I can repeatedly click the arrow on the slider beneath cover flow, nothing happens, click off the window and back on, and suddenly it has scrolled across. I updated to Safari 4 since the Beta and have had no luck since (I am currently using the newest Safari 4 version) so updating doesn't seem to help. Also clicking on an image on the Top Sites doesn't load the animation smoothly, it loads about one frame of the animation! Also youtube HD videos seem to struggle.
    It works perfectly If i try using Safari under a GUEST account on this computer. Also works fine on windows using a duel boot partition on this mac. I have a new Unibody Macbook Pro so the graphics card is fine. I have updated Flash, Java is up to date and I have tried deleting folders/files from Library that I have seen people suggest on other threads to see if that would also work for my problem. Uninstalling also doesn't seem to help.
    If ANYONE knows anything that would help I would greatly appreciate the help!!! Getting desperate now!
    Message was edited by: Bigbowser2

    I remember someone else had a similar problem after a computer crash.
    IIRC deleting the iTunes preference files fixed it.
    Resetting the iTunes Preference Files:
    You may need to make hidden files visible
    My Documents>Tools>Folder Options>View
    Check Show hidden files and folders
    -- Quit iTunes
    -- Delete C:\Documents and Settings\<your username>\Application Data\Apple Computer\iTunes\ iTunesPrefs.xml
    -- Delete C:\Documents and Settings\<your username>\Local Settings\Application Data\Apple Computer Inc\iTunesPrefs.xml
    For Vista the files are in:
    C:\Users\username\AppData\Local\Apple Computer\iTunes
    C:\Users\username\AppData\Roaming\Apple Computer\iTunes

  • Pointer (Java 2D/Graphics)

    I have Core Java I and am reading Chapter 7 (Working with 2D Shapes) and I am at the pointers part of the tutorial.
    My question is I cannot really say I fully understand Point(s, ers) with Graphics. So my question is I can use point and assign it to a pixel then have an image draw from that point and/or even connect to another point?
    However, sometimes you don't have the top-left corner readily available. It is quite common to have two diagonal corner points of a rectangle, but perhaps they aren't the top-left and bottom-right corners. You can't simply construct a rectangle as
    Rectangle2D rect = new Rectangle2D.Double(px, py,
       qx - px, qy - py); // Error
    If p isn't the top-left corner, one or both of the coordinate differences will be negative and the rectangle will come out empty. In that case, first create a blank rectangle and use the setFrameFromDiagonal method.
    Rectangle2D rect = new Rectangle2D.Double();
    rect.setFrameFromDiagonal(px, py, qx, qy);
    Or, even better, if you know the corner points as Point2D objects p and q,
    rect.setFrameFromDiagonal(p, q);Oh and supposedly I can use a 'point' as a starting (center) point for an ellipse...? I just want to make sure because I really want to learn this API...
    Edited by: Trizi on Mar 29, 2008 9:31 PM

    Trizi wrote:
    I was just reading that Point/Point2D can be used to drawing images less complicated to the panel. I just want to verify how I could use a Point2D/Point object. I want to verify that I can use it as a center (starting point) for an ellipse, and or beginning/ending points for lines/rects etc.huh? you CANT set any shape by its center.
    Point and Point2D are just convenience classes that store 2 doubles.
    the Shape classes dont take Points they take doubles.
    you could do:
    double centerX = 10;
    double centerY = 10;
    double radius = 10;
    Ellipse2D circle = new Ellipse2D.Double(centerX - radius, centerY - radius, radius * 2, radius * 2);
    see, you dont need Points.

Maybe you are looking for

  • OBIEE 11g drill down issue

    Hi, I've configured a hierarchy (level-based) on clustering attributes: info_data(id,gender,age,region,category,relevation_date,cluster_name) dimension_data(foreign_id,occurrences) in which the hierarchy is defined as: gender ->age -> region. I've do

  • Additional Excise Duty during procurement of excisable goos

    Hi, We are purchasing an Excisable Material from Domestic Vendor and he is charging the following: Assessable Value = 401,407.77 Basic Duty (8%) = 32,112.62 Edu Cess (2%) = 642.25 Sec Higher Edu Cess(1%) = 321.13 Additional Duty(4%) =         17,462.

  • My ping app wont open

    hey i have and ipod touch 4 and i have ping chat and ive had it for about a month now,and its like my favorite app ever, and its alway been kinda tempermintal and sometimes wont open and usually if i download another app it will open, but recently no

  • BT Infinity Ethernet extensions CAT6 or CAT5E?

    Hello BT is going to install BT Ininity 4 in my flat shortly, and offered me to install some ethernet extension throughout the flat to have fast internet in all rooms. Would anyone know by any chance whether they use CAT6 or CAT5E cables? I presume t

  • Old 8i Pro C applications against XE

    I have an old c++ application that is complied using the 8i Pro C compiler. The database this connects to I have successfully ported to XE. The application fails when running against XE. I cannot see any mention of Pro C support in XE. Can anybody po