applet

'appletviewer' is not recognized as an internal or external command, operable program or batch file

断了今生、忘了曾经 提交于 2019-12-31 05:11:05
问题 C:\Users\ms536\Desktop\java>appletviewer awt_ex.java 'appletviewer' is not recognized as an internal or external command, operable program or batch file. 回答1: I can think of three possible explanations for this: You may have not set the command search path ( $PATH ) correctly. This is a common for people who are new to Java; see javac is not recognized as an internal or external command, operable program or batch file You may be trying to use appletviewer in Java 11 or later. This won't work.

How do I play two sounds at once?

瘦欲@ 提交于 2019-12-31 04:11:06
问题 When I try to play two sounds at once in an applet, it won't work. I'm using AudioClip s. Is it even possible to play two sounds at once in an applet? 回答1: Since Java 1.3+, use the Clip class of the Java Sound API. It is similar to the applet based AudioClip class, but better. E.G. adapted from the one shown on the Java Sound info. page. import java.net.URL; import javax.swing.*; import javax.sound.sampled.*; public class LoopSounds { public static void main(String[] args) throws Exception {

Java: Add a Global Mouse Listener

亡梦爱人 提交于 2019-12-31 03:21:28
问题 I am developing a virtual keyboard using java applet. How do I set global mouse listener, so that I can get all mouse events inside my applet even if my applet is not the active window. And is there any way to get the focussed textbox globally, so that I can feed input to that textbox from my virtual keyboard. Thanks. 回答1: You need to make a hook for that you need native code for windows machine take a look here 来源: https://stackoverflow.com/questions/4673061/java-add-a-global-mouse-listener

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

Java slick, html cant find AppletLoader

本秂侑毒 提交于 2019-12-31 03:01:06
问题 I have made a java game using slick state based game, as my game extends StatBasedGame it is not a true applet because it doesnt extend JApplet, so to solve that problem there is a method build in with slick which can be used in html. I had found this link which showed me how to do this: http://ninjacave.com/slickapplet And did everything it asked me to do, I made a jar file of my game using eclipse (my compiler) , downloaded the latest version lwjgl and modified the code on the website shown

How to add image in the panel?

让人想犯罪 __ 提交于 2019-12-30 11:13:50
问题 I want to add an image in the panel together with the description but the description appear only in the list whenever I choose a year in my combobox, the problem is that the image didn't show in the lower part of the panel. I guess somethings wrong with my code. Could someone help me about this? This is what I've tried so far : public class Main extends JApplet { private String[] description; private JList list = new JList(); private DefaultListModel defaultListModel = new DefaultListModel()

Java Applet Windows size in Eclipse

守給你的承諾、 提交于 2019-12-30 10:47:06
问题 I am trying to set the size of an Applet Window to 500 by 500, but I couldn't be able to achieve that. Here is my code, public void init() { // Start Screen Color setBackground(Color.RED); this.setSize(new Dimension(500,500)); width=getSize().width; height=getSize().height; running=false; repaint(); offscreenImage = createImage(width,height); offscreenGraphics = offscreenImage.getGraphics(); addKeyListener(this); addFocusListener(this); waitingForSpace=false; repaint(); } When I pressed CTRL

how to drag object

自古美人都是妖i 提交于 2019-12-30 10:35:28
问题 i want to drag a box and i want my mouse cursor to be where i clicked in a rectangle while im draging rectangle. i tried this code and i got bunch of errors when i tried to drag. import objectdraw.*; import java.awt.*; public class TouchWindow extends WindowController { private FilledRect a; private boolean b; private Location c; private int x; private int y; public void begin() { b=false; a=new FilledRect(0,0,50,50,canvas); } public void onMouseClick(Location pt) { if(a.contains(pt)) { b

Chrome dropped Java support

烈酒焚心 提交于 2019-12-30 09:53:02
问题 I use Java applets in my application, today I surprisingly saw the redirect from my page and the next message from java In details I've read about Chrome dropping 'NPAPI' support Recently, Google has revised their plans and now state that they plan to completely remove NPAPI by late 2015. As it is unclear if these dates will be further extended or not, we strongly recommend Java users consider alternatives to Chrome as soon as possible. Instead, we recommend Firefox, Internet Explorer and

Chrome dropped Java support

不打扰是莪最后的温柔 提交于 2019-12-30 09:51:30
问题 I use Java applets in my application, today I surprisingly saw the redirect from my page and the next message from java In details I've read about Chrome dropping 'NPAPI' support Recently, Google has revised their plans and now state that they plan to completely remove NPAPI by late 2015. As it is unclear if these dates will be further extended or not, we strongly recommend Java users consider alternatives to Chrome as soon as possible. Instead, we recommend Firefox, Internet Explorer and