Space Travel computer java applet

Given two to four stars arranged as neighbors compute the
density of the space precisely midway between them based on
the size and density and temperature of the stars and the
makeup of them and the distance between them. Inputs are all
the data for each star and the ouput is the density of the
hydrogen gas at the point between the stars and also the
strength of the gravity fields from the stars at the midpoint between them. Input for one star could be
the radius of the star, the temperature of the surface and
the core, the density of the star, the makeup of the core
which tells how evolved the star is. Also one additional
variable is the density of the hydrogen gas around the star
which feeds the star, and this densisty is regulated by
the gravity of the star and the star population of the
neighborhood going out about 1,000 light years or more and
all considering the distance of the star from the galaxy
Who is Participating?
gadioConnect With a Mentor Commented:
Ok, heres a sample of (through what I undestand) your GUI can be. You need only to put the actual calculation into the last function. If you need more info - ask.

1. File

import java.applet.Applet;
import java.awt.*;

public class stars extends Applet {

    TextField fields[][];
    Checkbox stars[];
    TextField result;
    Button calculate;

     * Initializes the applet.  You never need to call this directly; it is
     * called automatically by the system once the applet is created.
    public void init() {
        fields = new TextField[4][6];
        stars = new Checkbox[4];

        setLayout( new BorderLayout());
        Panel mid = new Panel();
        mid.setLayout( new GridLayout( 5, 7 ));
        mid.add(new Label(""));
        mid.add(new Label("radius of star"));
        mid.add(new Label("surface temp."));
        mid.add(new Label("core temp."));
        mid.add(new Label("density"));
        mid.add(new Label("core makeup"));
        mid.add(new Label("hydrogen dens."));
        for( int star = 0; star < 4; star++ ) {
            mid.add( stars[star] = new Checkbox("Star "+(star+1),false) );
            for( int param = 0; param < 6; param++ ) {
                mid.add( fields[star][param] = new TextField(10) );
        Panel south = new Panel();
        Panel south_right = new Panel();
        south.setLayout(new GridLayout(1,2));
        south_right.add(new Label("result:"));
        south_right.add(result = new TextField(10));
        south.add(calculate = new Button("Calulate!"));
        add("North", new Label("Star calculations"));
        add("Center", mid);
        add("South", south);

     * Called to start the applet.  You never need to call this directly; it
     * is called when the applet's document is visited.
    public void start() {

     * Called to stop the applet.  This is called when the applet's document is
     * no longer on the screen.  It is guaranteed to be called before destroy()
     * is called.  You never need to call this method directly
    public void stop() {

     * Cleans up whatever resources are being held.  If the applet is active
     * it is stopped.
    public void destroy() {

    public boolean handleEvent( Event e ) {
        if( == calculate ) {
            return true;
        return false;


    private void doCalculations() {
        // Check which of the stars checkboxes is on and calculate accurdingly.
        // Put the result in the result textfield.
        result.setText("res"); // change this line.

Hope that helps you build your applet.
johnh619, is this homework? Is it a joke?   :-)
johnh619Author Commented:
No it is not homework or a joke. I want a java applet which I
can input info and then do the math and maybe eventually have
a graphical display. Can you help me? Really I am a novice. I have written one applet so far which I uploaded to my site and
is free. It is a double cache for netscape and IE. It switchs
the names around and leaves the fat file uneffected. I also
have another question in pending for a cache editor. These are
the two applets I am interesting in the most. I have a lot of java books but they just dont seem to answer all the questions.
Any help will be appreciated. I get confused when it comes to
choosing the method and figuring out if there is a method or a
method which I can facilitate; I figure I could learn the logic
and do it with logic if I spent enough time but the method might
be there already which would do it for me. So in my editor applet
I found that there were sort methods but I did not know which to
use and I thought there might be one to separate alpha and then
another for numberic. I just cant find the info. I did however
finally get this guys applet working which displays all the classes and lets you access Sun's site to get more info. He had
to change the memory allocation before it would load properly.
Finally though I did get it working with netscape.
is the url for his java explorer, if you have not seen it.
Sincerely JohnH
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

johnh619Author Commented:
Thank you gadio, if feel this is worth more than 50 points please
tell me, since I figure it does seem more to me than you. I only
have 85 points at present though. Please visit my website if
you wish: the subject space travel. is the main page.
I just finished compressing the graphics using the gif wizard
and it loads about twice as fast.
Really the subject of the applet is deeper than it seems on a
first glance level. The ramification of it is related to time
dilation. I wish to try to prove that though an astronaut may
only experience a few seconds of time distortion when they visit
the moon or mars, he may find extreme time dilation or contraction if he visit deep interstellar space. Therefore space
is only as euclidean as the space around one star. If you take
a group of stars then each creates its own euclidean space which
is not running at the same rate as its neighbor.
johnh619Author Commented:
I forgot to put a grade. Sorry!
johnh619, first I'd like to say that yes, I also feel that it worth a bit more but you problem is interesting so... :-)   Anyway, if you have any more Qs, or if youd like to add any graphic  representation of the problem later, you can address me with specific questions (I did a lot of graphics and animation in any languge).
Secondly, this is very interesting. I do know that the space is not euclidean, and I thought that it had to do with the effect of gravity fields of the stars (and singular points in black holes). Is this the base of your thesis or is it another idea? Are you doing this only as a theoretical expirimet or do you prove this through experimentation? How do you isolate deep space enviroment? I'm sorry if my Qs are simple and abstract. As an engeneer I took several courses in physics, but it is relatively only basic physics (I didn't get very deep on the theory of relativity).
johnh619Author Commented:
I did not figure how to give you more points after the question
is closed yet
You can issue an empty 'question' stating that its for me, and I'll answer it.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.