japplet

JApplet runs 30x slower than Java application GUI

女生的网名这么多〃 提交于 2019-12-11 09:27:08
问题 I work in HPC. I have both an applet and a Java client application that display information about jobs ( jobID, jobname, userID, etc. ) running on the cluster via information received from our TORQUE job scheduler. Recently, I added buttons to sort the data by category by ascending or descending values. With this addition, where the user has the ability to force an update of the display by sorting the data (previously I had a timer that received new data from the server every 10 seconds and

java.util.logger.Logger.getAnonymousLogger() throws NullPointerException

余生长醉 提交于 2019-12-11 06:27:01
问题 I just upgraded my Java plugin to 1.7.0_25, which caused a fatal error with an applet I wrote several years ago (and have been maintaining since). Early in the applet's init() method I call logger = Logger.getAnonymousLogger(); This call has been running since Java 1.4.2 without a problem. Now, with Java 1.7.0_25 (on Windows 7 at least; I've no Mac or Linux machine to test with here), the first time the applet is loaded, it works just fine. However if the applet's browser page is closed and

Working with JApplet with Menus

◇◆丶佛笑我妖孽 提交于 2019-12-11 05:37:51
问题 I'm having problems with my code. The sub-menu for the (Music) menu should be a radio button type. Here's my first code: import javax.swing.*; import java.awt.*; import java.awt.event.*; public class AMBAT_FLAB1 extends JApplet implements ActionListener{ JMenuBar mainBar = new JMenuBar(); JMenu menu1 = new JMenu("File"); JMenu menu2 = new JMenu("Format"); JMenu menu3 = new JMenu("Background"); //for file JMenuItem open = new JMenuItem("Open"); JMenuItem save = new JMenuItem("Save"); JMenuItem

Close event for applet?

ε祈祈猫儿з 提交于 2019-12-11 03:28:13
问题 I have a JApplet that adds a JPanel . I play some music in this, but when I close the web browser Java is still running and playing music. I couldn't find anything on this, but is there a way to override or catch the close event? I'd like to do a music.stop() or other such housecleaning to try and to get it to shutdown in a more graceful manner. 回答1: void destroy() Called by the browser or applet viewer to inform this applet that it is being reclaimed and that it should destroy any resources

How to run applet with policy permissions in Java to read the MAC address

拈花ヽ惹草 提交于 2019-12-11 00:22:36
问题 I'm trying to develop an applet in NetBeans which can read the MAC address. So here is my directory structure Here is my UPDATED Code MacAddrApplet.java import java.awt.Graphics; import java.net.NetworkInterface; import java.net.SocketException; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ArrayList; import java.util.Enumeration; import javax.swing.JApplet; /** * * @author jay.patel */ public class MacAddressApplet extends JApplet { public

How To Sign a Jar File for an Applet?

本秂侑毒 提交于 2019-12-10 20:36:15
问题 Does Singing a Jar File For an Applet use the same process as signing a Jar file for an application?? If so, can someone tell me how to sign it? I have an Applet that writes to your APPDATA, kinda like Minecraft. 回答1: Yes, it is the same process. Search for "sign jar" and you will find many tutorials. Here is a nice one 来源: https://stackoverflow.com/questions/7191411/how-to-sign-a-jar-file-for-an-applet

ActionListener between two classes

核能气质少年 提交于 2019-12-10 15:54:04
问题 import javax.swing.*; class Labels extends JFrame{ JPanel pnl = new JPanel(); ImageIcon duke = new ImageIcon("duke.png"); JLabel lbl1 = new JLabel(duke); JLabel lbl2 = new JLabel("Duke is the friendly mascot of Java technology."); JLabel lbl3 = new JLabel ("Duke", duke, JLabel.CENTER); public Labels(){ super("Swing Labels"); setSize(1000 , 800); setDefaultCloseOperation( EXIT_ON_CLOSE); add(pnl); setVisible(true); lbl1.setToolTipText("Duke - the Java Mascot"); lbl3.setHorizontalTextPosition

Adding JApplet into JFrame

时光怂恿深爱的人放手 提交于 2019-12-10 15:34:40
问题 I am trying to view a JApplet within a JFrame. Class: Paint public void paint(Graphics g) { g.drawString("hi", 50, 50); } public static void main(String args[]) { JFrame frame = new JFrame("test"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setJMenuBar(methodThatReturnsJMenuBar()); JPanel panel = new JPanel(new BorderLayout()); frame.add(panel); JApplet applet = new Paint(); panel.add(applet, BorderLayout.CENTER); applet.init(); frame.pack(); frame.setVisible(true); } The

Java applet blinking on Mac

非 Y 不嫁゛ 提交于 2019-12-10 14:27:14
问题 This problem is very weird . The issue does not occur on every platform . It occurs for me in Google Chrome, using MacOSX, but it doesn't occur in Safari. For a friend that uses Windows, on Google Chrome it works perfectly. I also have a friend that uses MacOSX and for him it blinks on Chrome, Safari and Firefox. We both have MacOSX Lion. I don't see any link. Can you people please test it and report if it happens or not, and what your platform is (it should occur within 30 seconds at most)?

IllegalArgumentException at URLPermission in jre8

一个人想着一个人 提交于 2019-12-09 23:31:32
问题 when i run the code below, -in an Applet on JRE8, on the line con.getInputStream() it throws the exception -in an Applet on JRE7 or JRE6 it does not throws. -in a Desktop app on any JRE it does not throws. when i remove the lines starts with setRequestPropery , it does not throws the exception on any JRE. URLConnection con = new URL(adress).openConnection(); con.setDoOutput(true); con.setDoInput(true); con.setUseCaches(false); con.setRequestProperty("Content-Type", "application/octet-stream")