applet

class can't be instantiated

落爺英雄遲暮 提交于 2019-12-13 13:47:37
问题 I have a problem with java applet and graphics. I'm trying to run it in Eclipse and it fails. Im new in java and i hope you can help me. I have two files: Say.java and SayWhat.java. Say.java: public class Say { SayWhat word = new SayWhat("Hello World"); } SayWhat.java: import java.applet.Applet; import java.awt.Graphics; @SuppressWarnings("serial") public class SayWhat extends Applet { Graphics g; String what; public SayWhat(String what) { this.what=what; } public void paint(Graphics g){ g

Applet shows up blank, not initializing?

为君一笑 提交于 2019-12-13 09:36:46
问题 Hello everyone my name is Fyree! I have an assignment for an introductory Java course where I need to create a program that takes user input for the beginning values, and all five year values to make a line graph (but that is for another post), and also print the rate. Here is my problem, when I try to run this applet it opens (it compiles without error), but only shows up as a blank screen, and says applet not initialized at the bottom of the applet. I am not sure why this is (currently I am

Using the paint or repaint method to paint lines over an applet JAVA

送分小仙女□ 提交于 2019-12-13 09:21:59
问题 I am wondering if it's possible to paint lines over an applet. I am loading the applet from an external source, but I'd like to paint lines where the cursor is on the screen. Can someone tell me how I'd do this please? Here's an example. g.drawLine(mouse.getLocation().x - 6, mouse.getLocation().y, mouse.getLocation().x + 6, mouse.getLocation().y); g.drawLine(mouse.getLocation ().x, mouse.getLocation().y - 6, mouse.getLocation().x, mouse.getLocation().y + 6); 回答1: I am wondering if it's

Publishing a .jar game online

情到浓时终转凉″ 提交于 2019-12-13 09:09:49
问题 I have created a simple java game and received a .jar file. I want to publish this game online on game websites (flash game websites such as kongregate, miniclip, etc.) but am unaware as how i would go about doing this. I have read that you create an applet to post the game online; but can I do that for a website that i am unable to edit? TLDR: How to post .jar file on website, & if you do so via applet, can someone who cannot edit the site create an applet for the website? If it is the

Java: In what order are the methods called in an Applet?

风格不统一 提交于 2019-12-13 08:12:45
问题 Of all these methods what's being run and in what order?? I guess the first question to ask is whats being run first? And why does th.start() start run()? import java.applet.*; import java.awt.*; import javax.swing.JFrame; public class BallApplet extends Applet implements Runnable { int x_pos = 10; int y_pos = 100; int radius = 20; private Image dbImage; private Graphics dbG; public void init() { // setBackground(Color.BLUE); } public void start() { Thread th = new Thread (this); th.start();

Servlet JApplet: HttpSession

穿精又带淫゛_ 提交于 2019-12-13 07:30:12
问题 This sounds like a simple question but I can't find good information. I'm writing a small JApplet that will be sending some info to a server servlet I want to be able to track who is who so I want to put up a system of logging and and session. I found some information about httpsession but I can never find one information: Do I have to create a session object in my applet or is there an automatic system that creates the httpsession when I do something like this on the applet side

Applet works, but swing components won't appear!

若如初见. 提交于 2019-12-13 06:29:41
问题 So I am creating this applet which I want to have full on swing components in it. I have looked at all the docs, I have made the applet, and I can get something to show up in it if I override the update(Graphics g) method, but simply adding components to the contentPane doesn't seem to be doing it! What am I doing wrong? import javax.swing.JApplet; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import org.steephill.kindlab.LabApp; import com.jgoodies

.class error in java applet

点点圈 提交于 2019-12-13 05:59:08
问题 I am writing an applet that will randomly pick 10 cards and show them on the screen. However, I am receiving a .class error and a ; needed error when I attempt to pass an String[]. Anyone help? This is my code: import java.awt.Graphics; import java.awt.Color; import java.awt.Image; import java.applet.Applet; import java.lang.Math; import java.util.Random; public class unit12Assignment extends Applet { Image card1 ... card52; public void init() { card1 = getImage( getDocumentBase(), "c1.gif" )

Getting Applets OutputStream throws an exception: What is wrong?

风格不统一 提交于 2019-12-13 05:44:18
问题 I have made an applet where I attempt to retrieve a URLConnection objects output stream using conn.getOutputStream(); . When I attempt to do this, my applet throws the exception java.net.UnknownServiceException: protocol doesn't support output . What is going wrong & how can I fix this? This has been a problem I have been dealing with for a while & I am really stressing because I dont understand what exactly is wrong & how I can fix it. Some important background information. I open & run my

Change java version used by java applets in browser

此生再无相见时 提交于 2019-12-13 05:43:05
问题 I am trying to do some automated testing with selenium on a site that has a java applet. Specifically, I want to test different java versions on different browsers. It is relatively easy to change the jre that is being used by local applications/commandline - usually just a modification of the PATH and perhaps a registry tweak (HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java Runtime Environment/CurrentVersion seems to need to be changed sometimes). But I can't seem to manage to change what a