Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 9 of 9

Thread: 3D shapes with java

  1. #1
    Junior Member
    Join Date
    Dec 2013
    Posts
    17
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Unhappy 3D shapes with java

    hello all , i have a problem which can't solve it for 2 days search :/

    i need to draw 3d shapes , i downloaded all packages

    and set an example code and run it

    this error appear !!



    Exception in thread "main" java.lang.UnsatisfiedLinkError: no J3D in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1886)
    at java.lang.Runtime.loadLibrary0(Runtime.java:849)
    at java.lang.System.loadLibrary(System.java:1088)
    at javax.media.j3d.MasterControl$22.run(MasterControl .java:889)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.media.j3d.MasterControl.loadLibraries(Master Control.java:886)
    at javax.media.j3d.VirtualUniverse.<clinit>(VirtualUn iverse.java:229)
    at SimpleTest.<init>(SimpleTest.java:39)
    at SimpleTest.main(SimpleTest.java:391)
    Java Result: 1






    can any one help please ?!? ?_?


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,195
    Thanks
    49
    Thanked 2,172 Times in 2,145 Posts

    Default Re: 3D shapes with java

    Did you look up the error message: UnsatisfiedLinkError? It's a class in the API doc
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Dec 2013
    Posts
    17
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default Re: 3D shapes with java

    okay , what i should do to fix this ?

    --- Update ---

    can you say to me the way to create a 3d objects with java.. ?!

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,195
    Thanks
    49
    Thanked 2,172 Times in 2,145 Posts

    Default Re: 3D shapes with java

    Read the installation instructions for the 3D package you are trying to use. I have never used it and don't know anything about it.
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member
    Join Date
    Feb 2014
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: 3D shapes with java

    //see if this helps: Credit goes to ('thenewboston') a youtube channel i subscribed to

    import javax.swing.JFrame;

    public class Example3DShape {
    public static void main(String[] args){

    JFrame f = new JFrame("Title");
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);// when the X is hit closes
    Example3DShape g = new Example3DShape();
    f.add(g);
    f.setSize(400,350);
    f.setVisible(true); //so you can see it
    }
    }


    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;

    public class Example3DShape extends JPanel {
    public void paintComponent(Graphics g){
    super.paintComponent(g);

    //set background color
    this.setBackground(Color.WHITE);

    //set color of 3D rectangle
    g.setColor(Color.ORANGE);
    g.fill3DRect(10, 170, 100, 60, true);
    }
    }
    Last edited by danthecardman; February 17th, 2014 at 11:24 PM. Reason: Housekeeping to make the code more legible

  6. #6
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    4,855
    My Mood
    Mellow
    Thanks
    178
    Thanked 631 Times in 618 Posts

    Default Re: 3D shapes with java

    @danthecardman: please post code between code or highlight tags. Read this topic to learn how to post code correctly and other useful tips for newcomers.

  7. #7
    Junior Member
    Join Date
    Feb 2014
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: 3D shapes with java

    Quote Originally Posted by GregBrannon View Post
    @danthecardman: please post code between code or highlight tags. Read this topic to learn how to post code correctly and other useful tips for newcomers.
    Thanks Greg. I've read enough of these posts and have seen this topic come up often enough (where people aren't respecting the rules of the forum). Yet come time to post my reply I couldn't locate these rules you provided the link to; as i did want to honor the forum guidelines and comply accordingly. So I appreciate the help; and will now submit my code per your request. Thank you sir.

     
    /*Credit goes to a YouTube channel I subscribe to: 'thenewboston' */
     
    //Main Class:  Example3DShape.java
    import javax.swing.JFrame;
     
    public class Example3DShape {
          public static void main(String[] args){
     
                JFrame f = new JFrame("Title");
     
                //Allows JFrame to close upon clicking X  
                f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                Example3DShape g = new Example3DShape();
                f.add(g);
                f.setSize(400,350);
                //set as true so you can see it
                f.setVisible(true); 
          }
    }
     
     
    //Seperate Class: Example3DShape.java 
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
     
    public class Example3DShape extends JPanel {
          public void paintComponent(Graphics g){
                super.paintComponent(g);
     
                //This sets background color to white
                this.setBackground(Color.WHITE);
     
                //This sets the color of 3D rectangle to Orange
                g.setColor(Color.ORANGE);
                g.fill3DRect(10, 170, 100, 60, true);
          }
    }

  8. #8
    Junior Member
    Join Date
    Dec 2013
    Posts
    17
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default Re: 3D shapes with java

    thanks danthecardman

  9. #9
    Junior Member
    Join Date
    Feb 2014
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: 3D shapes with java

    Quote Originally Posted by Zuckerberg View Post
    thanks danthecardman
    You're welcome; feels great when I can help someone out. Thank you for replying back.

Similar Threads

  1. Showing Shapes
    By marc172 in forum AWT / Java Swing
    Replies: 1
    Last Post: January 27th, 2014, 07:27 AM
  2. Objects - Moving Shapes in JAVA HELP PLEASE!
    By imzy in forum Object Oriented Programming
    Replies: 1
    Last Post: October 10th, 2013, 07:08 PM
  3. Combining Shapes + Text
    By aussiemcgr in forum Java Theory & Questions
    Replies: 5
    Last Post: February 17th, 2011, 09:15 AM
  4. How I can create those shapes with Java?
    By Learner in forum AWT / Java Swing
    Replies: 3
    Last Post: November 18th, 2010, 01:10 AM
  5. Converting Images to Shapes
    By Ian in forum Java Theory & Questions
    Replies: 2
    Last Post: February 7th, 2010, 04:18 PM