japplet

MouseDragged & MouseMoved not working in Java Applet

谁说胖子不能爱 提交于 2021-02-16 16:25:30
问题 I'm currently working on a map generation program for a game I'm creating, and so I'm trying to be able to modify the individual tiles on the map using my mouse. I've successfully implemented the ability to click on a tile and change its value (from say a 4 way tile to a 2 way tile), but I am having trouble getting mouseDragged to work. According to the Java docs I've done the correct implementation of the mouseDragged interface into my MouseEventHandler, but I when I drag my mouse and move

How do I deploy my java application onto a website?

三世轮回 提交于 2020-02-07 09:28:22
问题 I just complied all my java programs, which consists of 4 classes and everything's working fine. I have the GUI, client, server, and the action listeners and an image all in the same folder. I just don't know how to put my local java application that I debugged and tested in JGrasp software onto my webpage. I looked around and I read you need to make a jar file and compress all of them, but I don't know how to do that, neither creating an applet. I tried the most simple way of doing it by

Applet Flickers even after using using Double Buffering

荒凉一梦 提交于 2020-02-05 04:27:10
问题 I am trying to make a 2 player Pong Applet where the user controls the paddle using mouse. I have used the concept of Double Buffering , but the Applet still flickers !!! What is the mistake I am committing ? import java.awt.Color; import java.awt.Graphics; import java.awt.Image; import java.awt.event.MouseEvent; import java.awt.event.MouseMotionListener; import java.util.Timer; import javax.swing.JApplet; public class Pong extends JApplet implements Runnable, MouseMotionListener { Ball ball;

Add background image into applet frame

半世苍凉 提交于 2020-01-07 08:29:03
问题 I am trying to add a background image to my applet, but don't know how to add. Here is my code. public class SAMmain extends JApplet{ public JMenuBar mbar=new JMenuBar(); public JMenu newStudent,viewtudent,markAttendence; public void init() { setSize(1366, 768); setJMenuBar(mbar); newStudent= new JMenu("New Student "); mbar.add(newStudent); viewtudent= new JMenu("View student"); mbar.add(viewtudent); markAttendence= new JMenu("Mark Attendence"); mbar.add(markAttendence); } public void start()

How can identify Applet subclasses from a Jar file?

无人久伴 提交于 2020-01-06 22:44:19
问题 I have the two following class hierarchy in jar files where the only difference is that Main in example2.jar has no package while Main in example1.jar is part of the package user . example1.jar // user/Main.java package user; import Engine.GameWindow; public class Main extends GameWindow { } // Engine/GameWindow.java package Engine; import java.applet.Applet; public abstract class GameWindow extends Applet { } example2.jar // Main.java import Engine.GameWindow; public class Main extends

How to make a layout for JApplet

你离开我真会死。 提交于 2020-01-04 12:49:08
问题 I am creating a simple Sudoku game. Since this is my first "big" i want to do everything myself (without the NetBeans interface designer that i normally use to make GUIs). So for the GUI i created a class that extends JApplet and i drew a simple sudoku field in the paint() method. Now i need to make 81 text fields each of which will take in 1 number. How do i position them on the screen? Also, i was thinking of making an array so i'll be able to change the enitre matrix of fields with one for

Giving a JApplet read write access to the local file system

≯℡__Kan透↙ 提交于 2020-01-03 05:14:31
问题 I have a JApplet that I want to give read write print etc permission to. This applet is loaded only from the local file system I have been reading through the controlling applets part of the java tutorials and have successfully created a policy file, giving permissions and specifying the code base http://docs.oracle.com/javase/tutorial/security/tour1/index.html To get the example applet to write to the local system successfully I had to add this line to the java.security file. policy.url.3

JApplet not running: < No main classes found >

a 夏天 提交于 2019-12-31 03:05:09
问题 My JApplet is producing a error when DrawOvalInputs.html runs and calls the class file of DrawOvalInputs. So far, I have only been able to get it work as an actual application (Which is why the main is in a block quote). My goal for this program is to be able to run a .html file to start up the JApplet with a medium security setting on the java console, yet no matter what I've done it simply won't function. I have looked around on quite a few pages and searches before coming here. Regrettably

How to hide JDialog from JApplet when user switch browser tab?

╄→гoц情女王★ 提交于 2019-12-30 22:59:56
问题 Problem: user starts long operation from applet; JDialog with progress bar is displayed. User open/switch to another browser tab - JDialog is still displayed (and annoys user). JDialog should be hidden when user switch to another tab; and displayed again, when user switch back. Note: I saw question with similar problem, where solution was add windowActivated/deactivated listener. It doesn't work for me, because there are multiple frames in window, and one of them contains applet. When user

Java JApplet to JFrame

风流意气都作罢 提交于 2019-12-30 12:22:50
问题 I want to convert a JApplet to a JFrame. I have found this code on the internet that is a word search game. I want to use this code in a demonstration for a class. but I don't want it in an applet. The code that I was going to paste in here was to large by about 7,000 characters. I tried taking the JApplet and extending a JFrame and then putting all of the code for the initialization into a constructor (Zero Argument constructor). This cause about ten errors that I couldn't get fixed. I want