J3d and swing - dukes dollars!
am trying to get my j3d scene to display in a swing JFrame
JPanel pane1 = new JPanel();
pane1.add(universe.canvas3D);
frame3D = new JFrame("Hiya");
frame3D.getContentPane().add(pane1, BorderLayout.CENTER);
frame3D.setBounds(400, 400, 400, 400);
frame3D.setVisible(true);
this doesn't wrok, get a nullpointer exception... anyone help?
Hum.. seems to me that you might have forgotten to create the Canvas3D Object, thus resulting in a null pointer exception. Can't tell it without having all the code.. anyway here's an example of how I do it.
Also be careful because there are issues in mixing lightweight (swing) and heavyweight (Java3D) components. See the faq at www.j3d.org, there are also examples.
JPanel contentPane = new JPanel();
contentPane.setLayout(new BorderLayout());
// my class extends JFrame, thus the following replaces the default content pane
setContentPane(contentPane);
// This is a method of my class that add swing components
initUI(contentPane);
GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
// Here we go, create the Canvas3D
Canvas3D canvas3D = new Canvas3D(config);
// Here you embed Java3D into the Swing
contentPane.add("Center", canvas3D);
SimpleUniverse simpleU = new SimpleUniverse(canvas3D);
JPanel pane1 = new JPanel();
pane1.add(universe.canvas3D);
frame3D = new JFrame("Hiya");
frame3D.getContentPane().add(pane1,
BorderLayout.CENTER);
frame3D.setBounds(400, 400, 400, 400);
frame3D.setVisible(true);
this doesn't wrok, get a nullpointer exception...
anyone help?
Similar Messages
-
Duke Dollars, What are they and why are they in this forum?
Hi,
Can somebody please tell me what duke dollars are and why they are in this forum? some topics have duke dollars, but don't know what that means.
Thanks in advance
Arjenhahahahha... the moment i posted this topic, i received the link to assigning dollars to a topic as well as a link to what duke dollars are. :) lol
-
I wanna assign you ALL my Duke Dollars....
...for a new question i have BUT b4 I can do that I need to retrive back the duke dollars from my earlier messages that haven't been answered and have my dollars gathering dust...how on earth do i do that?
Silkm I have no issues with assigning you all my dukes from all those earlier questions...just go there, type anything and I will assign them to you if u can solve my query...
It's gotta do with setting the classpath...and yes, i have already been thru google and forums here...
This is what i do:
- Start>Control Panel>System>Advanced>Environment Variables
- Click on Path in the System Variables section
- Click Edit and add C:\Program Files\Java\j2re1.4.1_01\bin AFTER %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;c:\Program Files\Common Files\Adaptec Shared\System;
- Next I go to DOS and get my C prompt to C:\Program Files\Java\j2re1.4.1_01\bin
- I type javac helloworld.java and ENTER
- I get "javac is not recognised as an internal or external command, operable program or batch file"
So then I go back to Start>Control Panel>System>Advanced>Environment Variables
- This time I click on New in the "User Variables for Gaurav" section(that's me) - after all i am logged in as Gaurav on my XP machine!
- I type Path in Variable Name and C:\Program Files\Java\j2re1.4.1_01\bin in Variable Value
- Save
- goto DOS
- type helloworld.java and get "javac is not recognised as an internal or external command, operable program or batch file"
BTW i have installed j2re-1_4_1_01-windows-i586 on a XP machine
HELP! -
I tried to assign Duke Dollars to my last post. It says that I have 50 dollars to assign. Whne I try to assign them I get a 500 Server error. i kept trying and it eventually displayed a stack trace stating the user has insufficient dollars. What Gives?
I'd tell you if there were some Dukes on offer.
-
SDN Forum points vs Sun Forum Duke Dollars
I believe that a points system is a great way to encourage participation by the community in problem solving.
With the points system in SDN, however, there is room for abuse, for example, by having people you know award points to you on threads.
I personally like the points reward system (Duke Dollars) on Sun's Developer Forums. In this scheme, you work with credits. Every user is given a certain amount of points (Duke Dollars) when they join. When you post a question, you can assign a number of Duke Dollars up front from your available credit as a reward to entice responses. You can also accumulate more Dollars by answering threads which have Dollars assigned.
Every month, Sun gives a gift to the user who has accumulated the most points.
I'm not sure that this solves the problem of users not assigning points for valid help, but, because users are working with limited credit, it does force them to be careful when assigning points, and prevents abuse as that mentioned above.
I would like to hear what other people think about this scheme. Perhaps there are aspects I have not considered.
Regards,
MartinWould a moderator make it more positive?
Actually Craig went into each of the forums and published a "rules of engagement". Maybe that kind of a "sticky note" post would be the place to remind people about the inappropriateness of redundant questions (across various forums) and the confusion and poor sporting behavior associated with "copied" answers. I can ping Craig with that suggestion to add text if you think it makes sense to "remind" people in each of the respective forums.
Or..to be a little more provocative, we could suggest that community members who have a good track record of participation, collaboration, and exemplary attitude be given the moderator rights in forums where the activity volume might be too overwhelming for an SAP moderator alone to manage and given the rights to move content to a more appropriate thread.
This is what I meant about "self-policing". Also, perhaps the moderators (internal as well as SAP) could identify themselves in a sticky post and invite participants in those designated threads to track "abuses" or issues, thus identifying them and hopefully resolving them publically.
Strange, it reminds me that in old, Puritanical, America, of the 17th century community culprits were subjected to a public dunking or stocks when they broke the law. The purpose being that public condemnation sent a clear message to other "would be" misbehavers.... and thus deterred further bad conduct.
While a rather radical and unpleasant method it was an open way of dealing with abuses to the system.
Perhaps others can offer less extreme and more effective suggestions here
Marilyn -
Hi
I have some duke dollars which i have assigned to a post, but no one seems to answer me the question properly, So i am asking people to quickly push some valid answers for this and claim their worthy duke dollars.
To claim the duke dollars kindly go to this thread and answer it
9 duke dollars are available
http://forums.java.sun.com/thread.jsp?forum=45&thread=133596
Thanks
SwarajThe duke dollars are over.
Thanks
Swaraj -
If you say you are going to give duke dollars, then give duke dollars. :o)
Ah, that is meant by this -
sorry, I have sometimes problems to understand the meaning of some saying - I am not a native english speaker. You are right - but, I guess, some newbies don't know how to award a good answer - I read this in a post, where a guy wants to award a reply, not knowing how to do that.
greetings Marsian
P.S.: I am not a Martian boy :) - this name is a fantasy name used in MUDs, derived from the Roman god of wars "Mars" and converted to a name in the same way as "Christ" is converted to "Christian". -
Go to your "My Duke Dollars" and click on the link to "Duke Dollars Rewards Program Account Summary".
And??What does it give you because for me it gives memy
'profile management'?No. I get my list of dukes spent, gained, totaland
recent activity.I too. Sometimes. Other times, I get a 404 or a
log-in and my profile.Do you remember all the shenanigans with your user profile. How you had to confirm something or whatnot a couple of years ago so they could "centralize" and "streamline" the one Sun account login thingy?
That worked out well didn't it. Much better now.
Vote "Don't touch it!" in Sun's feedback poll http://forum.java.sun.com/thread.jspa?threadID=710736&tstart=0 Sun should fix the bugs in the forum software before fiddling around with the GUI. -
i am a new user to java forum,i want to know about the Duke Dollars
The FAQ there is a little out of date.
They don't give away prizes anymore like it says (I have heard from of at least one person who got something)
Since that time Duke dollars have become a bit of a joke.
Too many people were "cheating" with dukes - just creating throwaway names, and awarding themselves duke dollars.
You used to be able to see how many duke dollars a person had - which was a small indication of the "expertise" of the person. That was removed in one of the forum "upgrades"
So now you can't even use them for that. You can still issue them if you want to. It probably won't affect the answers though. -
I would just like to know what Duke Dollars are and what they do for me, can I make money with them, can I feed the poor with them?
I was wondering myself. To answer your questions, looks like no and no.
http://developer.java.sun.com/developer/community/dd.jshtml#whatare -
It is mostly thanks to reading DrClap's responses in the archives that I got my serial port problem resolved so here are 10 Duke Dollars for him.
Just leave a message and I'll award them to you. Thanks for your past responses.
see: http://forum.java.sun.com/thread.jsp?forum=4&thread=174689You're welcome.
-
Duke Dollars for the first to implement the JOSRTS Tech Test
See http://www.josrts.org/cgi-bin/ikonboard/ikonboard.cgi?act=ST;f=6;t=124
If the offered Duke Dollars aren't showing up, it's because I haven't figured out yet how to attach them to the post. Give me some time, it's the first time I've offered them. :-)The following errors were found:
The board administrator requires that all members log
in before viewing the boardSorry, that's just the way the board is set up. Feel free to create a login and lurk around.
For those of you unfamiliar with JOSRTS (http://www.josrts.org), it is an attempt by the community to create a Real Time Strategy game in Java. This challenge is meant for members of the project, but if anyone would like to join the project, feel free. -
Hi,
I have posted couple of questions with DUke Dollars. I did not reward them because nobody answered my question. Now i can i use those dollars in my New Posts.
thanks.You can also un-assign them (get them back) assuming Sun hasn't changed the web site lately, but I don't remember exactly the URL you have to hit. Search the forums for "reward.jsp" and see if you can find another post about doing that.
-
How are duke dollars distributed?
Hi all,
I wonder.... For the last 2 months, I replied on several messages with Duke Dollars on it. But those Duke dollars were never attributed to anyone. Very often there wasn't even a feedback from the person that posted the message.
What happens with those dollars?
MarcDon't let others fool you.
I am collecting all unassigned dukes. Just post the
threads you have been answering and I'll make sure you
get those dukes (charging only a small fee).Don't trust him! He said he would collect for me but instead he intimidated the user into giving him all their Duke Dollars! -
10 Duke Dollars if you help me set up tutorial
After several posts to this forum w/o any success, I am now offering 10 Duke Dollars to get this problem fixed:
I am trying to work through the j2ee tutorial on a Windows XP platform, specifically the servlets section which requires me to build the bookstore1 example (chapter 11). I am having problems with using asant to compile and package the project. I have been at a complete standstill for about a week now because I cant get the example to run - Im tearing my hair out, so plese help me!!!
The command I am using is asant create-bookstore-war. This throws about 80 compilation errors because classes referenced within the source files are not found . I therefore know that the compiler cant find the classes (suggesting CLASSPATH problems), but I dont know what settings Im supposed to be using.
Some info for you:
I tried adding JAVA_HOME and J2EE_HOME to the environemt variables, pointing to the java sdk (inside the app server) and J2EE application server installation location respectively. This didnt work. Initially I had JAVA_HOME pointing to a seperate installation of the SE SDK I had, but since discovering the SDK inside the appserver, I uninstalled J2EE, J2SE SDK, and re-installed J2EE, using the enclosed sdk as JAVA_HOME. None of this solved my problem.
I think I know now that the environment variables are not anything to do with the tutorial - this is just for the locations of the J2EE and J2SE SDK command path files - is this correct? In which case, using J2EE_HOME and JAVA_HOME is just for shorthand declarations in the environemtn/system variables?
(As you can probably guess by now I have spent a lot of time trying out different things!!!).
I also tried setting the j2ee.home and j2ee.tutorial.home attributes in the build.propoperties file located in <INSTALL>/j2eetutorial14/examples/common. This didnt work. I also tried setting the admin username property in this file, and the corresponding password in the password file (cant remember offhand what its called). Again, no luck.
In another post, somebody asked for the following oputput from my system:
D:\J2EE\j2eetutorial14\examples\web\bookstore1>asant listprops
Buildfile: build.xml
listprops:
[echo] Path information
[echo] j2ee.home = C:\Sun\AppServer
[echo] env.Path = C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C
:\BORLAND\BCC55\BIN;C:\Sun\AppServer\jdk\bin;C:\Sun\AppServer\bin;
[echo] env.PATH = ${env.PATH}
[echo] Classpath information
[echo] classpath = .;D:\Packages;
[echo] Admin information
[echo] admin.password = ${admin.password}
[echo] admin.host = localhost
[echo] admin.user = admin
[echo] admin.port = 4848
[echo] https.port = 8181
[echo] Domain information
[echo] domain.resources = "domain.resources"
[echo] domain.resources.port = 8080
[echo] Database information
[echo] db.root = C:\Sun\AppServer/pointbase
[echo] db.driver = com.pointbase.jdbc.jdbcUniversalDriver
[echo] db.host = localhost
[echo] db.port = 9092
[echo] db.sid = sun-appserv-samples
[echo] db.url = jdbc:pointbase:server://localhost:9092/sun-appserv-samples
[echo] db.user = pbpublic
[echo] db.pwd = pbpublic
[echo] url.prop = DatabaseName
[echo] ds.class = com.pointbase.jdbc.jdbcDataSource
[echo] db.jvmargs = -ms16m -mx32m
BUILD SUCCESSFUL
Total time: 1 second
D:\J2EE\j2eetutorial14\examples\web\bookstore1>There must be somebody out there who has set this tutorial set up on Windows XP - please can you give me a dump of your system and environment variables, and any other settings I need (build.properties etc.).
Many thanksHeres the last couple of errors on running asant creat-bookstore-war. All errors are cannot resolve symbol, so im sure its a classpath problem.
I only have PATH properties set in the environment variables, and the set CLASSPATH only points to my own J2SE packages.
[javac] D:\J2EE\j2eetutorial14\examples\web\bookstore1\src\servlets\ShowCart
Servlet.java:147: cannot resolve symbol
[javac] symbol : class ShoppingCartItem
[javac] location: class servlets.ShowCartServlet
[javac] ShoppingCartItem item = (ShoppingCartItem) i.next();
[javac] ^
[javac] D:\J2EE\j2eetutorial14\examples\web\bookstore1\src\servlets\ShowCart
Servlet.java:148: cannot resolve symbol
[javac] symbol : class BookDetails
[javac] location: class servlets.ShowCartServlet
[javac] bd = (BookDetails) item.getItem();
[javac] ^
[javac] 68 errors
BUILD FAILED
file:D:/J2EE/j2eetutorial14/examples/web/bookstore1/build.xml:56: Compile failed
; see the compiler error output for details.
Total time: 8 seconds
D:\J2EE\j2eetutorial14\examples\web\bookstore1> and heres the build.properties file:
j2ee.home=C:\\Sun\\AppServer
j2ee.tutorial.home=D:\\J2EE\\j2eetutorial14
sunone.home=${j2ee.home}
admin.password.file=${j2ee.tutorial.home}/examples/common/admin-password.txt
admin.host=localhost
admin.user=colr
admin.port=4848
https.port=8181
domain.resources="domain.resources"
domain.resources.port=8080
db.root=${j2ee.home}/pointbase
db.driver=com.pointbase.jdbc.jdbcUniversalDriver
db.host=localhost
db.port=9092
db.sid=sun-appserv-samples
db.url=jdbc:pointbase:server://${db.host}:${db.port}/${db.sid}
db.user=pbpublic
db.pwd=pbpublic
url.prop=DatabaseName
ds.class=com.pointbase.jdbc.jdbcDataSource
db.jvmargs=-ms16m -mx32m Thanks.
Maybe you are looking for
-
Ping shot up and pages not loading correctly
Hi guys, For some reason there appears to be a slight problem and I'm not entirely sure what it is. My ping is fluctuating around 110-160ms and the connection is not being stressed in any way. Also, the ping to the exchange/POP is 8/7ms and it also i
-
Underlining characters in a string
Is there an easy way of making an underline mark appear beneath a character in a string? I'm thinking along the lines of some escape character that causes the next character to be underlined. e.g. new String("\uContents"); would cause the 'C' to be u
-
Beehive Group - Returned mail: see transcript for details
Hi All I am owner of "[email protected]" Beehive Group Mailing List Since last week , Email sent by team members to "[email protected]" is not getting delivered ! Error The original message was received at Tue, 7 Feb 2012 03:54:54 -0600 from abhmt119
-
Macbook Pro Retina Display Notification Centre Pixelated. Any Fixes?
I've frequently wondered why on the Retina display macbook, my notification centre is pixelated? Anybody have any reasons as to why? or if there is a fix for this? Many thanks Mark
-
Is there any book available for clustering, which would give details like how the beans are to be coded, what are the pitfalls, performance tuning, testing the failover etc etc.. I am new to clustering and am wondering h