Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 01-27-2008, 03:40 PM   #1
Solid State Member
 
Join Date: Jan 2008
Posts: 8
Default Java Questions

I just took a course on HTML, Javascript, and Java programming and I am now studying on my own.

I was just wondering if Java can be used outside of it's little cmd box, because thats all i can seem to do with it.

When i compile and use on JCreator it opens a little black cmd box and runs it there, but i want it to do other stuff, like open other programs on my computer or open a webpage... ANYTHING BUT THAT LITTLE BLACK BOX!

Going insane...

Stabering
__________________

Stabering is offline   Reply With Quote
Old 01-27-2008, 04:08 PM   #2
Site Team
 
celegorm's Avatar
 
Join Date: Sep 2006
Posts: 10,713
Send a message via AIM to celegorm
Default Re: Java Questions

ah Jcreator, pain in the butt if you ask me, but it works.

The "black box" is a Java application. If you want to have like a normal window, you want an applet. Off hand I don't remember how to set that up.
__________________

__________________
"as a fanboy i refuse to admit it and will pull countless things out of my butt to disprove it"

Team Thelegorm! Total Kills: 21 (i iz in uor profile, editsing your sigz)
celegorm is offline   Reply With Quote
Old 01-27-2008, 04:23 PM   #3
In Runtime
 
CGfreak102's Avatar
 
Join Date: Apr 2007
Posts: 475
Default Re: Java Questions

There are some good documents and code chucks that kind of show you how to make some apps. here is a link. www.java.sun.com

and click on documents or tutorials under resources, that can help you, and same here with me i havent used java in about 6 months, and all my files i had stored on my flash driver got wiped, and made me mad.
__________________
Core I7 920 OC'ed to 3.0Ghz, 6GB G.skill DDR3 1333, Intel DX58SO, 500GB seagate 7200RPM + 320GB seagate, EVGA 9800GTX+ , 600W PSU.
CGfreak102 is offline   Reply With Quote
Old 01-27-2008, 08:17 PM   #4
Solid State Member
 
Join Date: Jan 2008
Posts: 8
Default Re: Java Questions

Is it possible to like make a file that when its run it opens other files? Or does that what App does..?
Stabering is offline   Reply With Quote
Old 01-28-2008, 10:13 AM   #5
In Runtime
 
CGfreak102's Avatar
 
Join Date: Apr 2007
Posts: 475
Default Re: Java Questions

app means application. you can write a HTML file that you load in your web browser and then it will load up the game in in the browser and you can play it that way, no sure about it opening other files, was never taught that.



sorry i miss spoke there, an application is that black screen you are talking about a applet is what you want here is a small chunk of code that is pretty much the Hello world thing for applets


Code:
/* The HelloWorld class implements an applet that
   displays "Hello World!" within an XHTML document. */
import java.awt.*; import java.applet.*;
public class HelloWorld extends Applet
{
  public void init()  // Initialize the canvas
  {
    Color lightgray=new Color(211,211,211); // customize
    setBackground(lightgray);  // make mellow background
    resize(150,10);
  }
  public void paint(Graphics g)  // Display Hello World!
  {
    g.drawString("Hello World!",50,25);
  }
}



this is a section of code you can use to load or play the applet in a web browser, save it as a HTML file in the same folder as your project or give the right directory to find it in.


Code:
<applet code="HelloWorld.class" codebase="javaProj/" height="70"
  width="300" <param name="image" value="anintro.jpg"></param>
  Your browser does not support Java!</applet>
but that looks different than how i used to type them.
__________________
Core I7 920 OC'ed to 3.0Ghz, 6GB G.skill DDR3 1333, Intel DX58SO, 500GB seagate 7200RPM + 320GB seagate, EVGA 9800GTX+ , 600W PSU.
CGfreak102 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 10:57 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0