Reputation: 14029
I've got a java code that I found and adapted to my project. I am trying to build a java applet out of it. My problem is that from some reason the code demands me to add a JFrame to my applet. If I add a JFrame it works fine (The code has several threads its working on, perhaps it's connected?), the problem is that the JFrame causes another window to pop up, which is problamtic.
I am sorry but I really don't think that if I post the code it will help. There are many lines and I doubtful if there's a single failure point to point out. I am just looking for a genereal direction... How can I add a JFrame so it will not popup in a new window, or alternativly how can I take a piece of code that works in an ordinary Java Application and get it to work in a JApplet wihtout the need to add JFrames?
Upvotes: 0
Views: 1547
Reputation: 131550
Take the content pane of the JFrame
and move it to be the content pane of the JApplet
.
If you want anything more than that, you'll probably need to post the code. (It almost always helps.) You could post it at a code-snippet website like pastebin or dpaste or whatever, and then just edit your question to include a link.
Upvotes: 3