Java_chic needs help please!!!!!!

Hi.
I have two programs, BGroup.java, which creates a rotating sphere and coloring attributes etc. and some1Canvas3D.java which creates a canvas and simple universe and panel with buttons and works on the BGroup.java program by adding it as a branchgraph to the simple universe "simpleU.addBranchGraph(new BGroup());". what i'd like to do is that if one of the buttons in some1Canvas3D.java is pressed then i want to decrease/increase the radius size of the sphere in BGroup.java. and see this within the canvas.
I'm not Interested in what the program does but only how interaction between two programs work.
If anyone has any ideas how to do this, that'd be great.
The code for the two programs is below . i'm quite new to Java3D so i hope it makes sense.
Thanks for you help.
Sharon
/********BGroup.java****************
import com.sun.j3d.utils.geometry.*;
import javax.media.j3d.*;
import javax.vecmath.*;
import com.sun.j3d.utils.image.TextureLoader;
public class BGroup extends BranchGroup
public BGroup()
/*create the transformGroup and set the capability to write.needed for rotation*/
TransformGroup someGroup = new TransformGroup();
someGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
//add the transform group to the branchgroup
this.addChild(someGroup);
//create the sphere and add it to the scene
Sphere mysphere = new Sphere(0.5f);
someGroup.addChild(mysphere);
// Create a light that shines for 100m from the origin
Color3f light1Color = new Color3f(7f, 2.6f, 4.1f);
BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);
Vector3f light1Direction = new Vector3f(9.0f, -7.0f, 5.0f);
DirectionalLight light1 = new DirectionalLight(light1Color, light1Direction);
light1.setInfluencingBounds(bounds);
someGroup.addChild(light1);
Transform3D yAxis = new Transform3D();
Alpha rotationAlpha = new Alpha(-1, 4000);
RotationInterpolator rotator =
new RotationInterpolator(rotationAlpha, someGroup, yAxis,
0.0f, (float) Math.PI*2.0f);
rotator.setSchedulingBounds(bounds);
someGroup.addChild(rotator);
this.compile();
*********************some1Canvas3D.java******************/
import java.awt.*;
import java.awt.GraphicsConfiguration;
import com.sun.j3d.utils.applet.MainFrame;
import com.sun.j3d.utils.universe.*;
import com.sun.j3d.utils.geometry.*;
import javax.media.j3d.*;
import java.applet.*;
import java.awt.event.*;
import java.awt.event.WindowAdapter;
public class some1Canvas3D extends Applet {
private Button go = new Button ("Forward");
private Button go2 = new Button ("Left");
private Button go3 = new Button ("Right");
private Button go4 = new Button ("Back");
private Button go5 = new Button ("Do it for me !!!");
public void init()
setLayout(new BorderLayout());
GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
Canvas3D c1 = new Canvas3D(config);
c1.setSize(256,256);
add("Center", c1);
SimpleUniverse simpleU = new SimpleUniverse(c1);
simpleU.getViewingPlatform().setNominalViewingTransform();
simpleU.addBranchGraph(new BGroup());
Panel p = new Panel();
p.add(go);
p.add(go2);
p.add(go3);
p.add(go4);
p.setBackground(Color.blue);
p.setForeground(Color.red);
add("North",p);
Panel p2 = new Panel();
p2.add(go5);
p2.setBackground(Color.blue);
p2.setForeground(Color.red);
add("South",p2);
public void start() {
public void destroy() {
public void run() {
//Explains what happens when the Mouse is clicked on the Applet
public void actionPerformed(ActionEvent e) {
if (e.getSource()==go ) {
/*when this button is pressed i want to be able to decrease the radius size of the sphere in BGroup.java*/
public static void main(String []args)
System.out.println("Program Started");
new MainFrame(new some1Canvas3D(), 750,500);
*************************/

One of the approach you might take regarding this program is : taking off the previous sphere whenever decrease or increase button is hit, then replace it with a new sphere with appropriate size "bigger or smaller".
I don't know how to do it yet as I'm still in my 2nd or third week of Java3d learning "I'd call it fooling around :D", but if I get a chance, I might give it a shot :)

Similar Messages

Maybe you are looking for

  • Office 2013 Click to Run - VAMT error: product SKU is not found

    We failed to install the retail key for Office 2013 Home and Business Retail through VAMT. Error is: The Software Licensing Service reported that the product SKU is not found. VAMT key install and activation worked fine with other retail products. I

  • Solution to ipod troubles!!!

    Green/amber light flashing? Error 1418 message? Ipod not recognized by pc/mac or itunes? Device error? Etc... After wasting several frustrating days, reading and trying out the many options posted in this and numerous other threads (Thanks to all of

  • Fun and games installing Oracle ...

    For various reasons we still use Oracle 8.1.7.4 on Solaris 8 (yes yes I know ... it was the version that Noah used to run the Ark but I am stuck with it so please no suggestions about upgrading :-) ) I decided to attempt to install Oracle 8.1.7.4 on

  • Can we refresh RSPCM transaction in background ??

    Hi guys, I am working in BI 7 landscape, where there are around 120 process chains. I have included all these chains in the RSPCM transaction to monitor the daily loads. But the problem is that it take around 8 minutes or more to get refreshed in for

  • Archive Link Creation for IXOS

    HI, I have an requirement to create custom output using smartform for invoice. Convert output into PDF and create ARCHIVE LINK to store that document into IXOS server. I have finished part upto creating PDF from smartform. Can someone suggest procedu