Applets in Mac OS
Hi Java Guys,
When I tried to open an html in the local system, that had an applet embedded, I could see the applet displayed inside the html. But when I put the same page and applet to some other machine and tried to access the html via ip address, only the html contents were seen and the applet did not load.
The first error I noticed was "Class not found". Some how I solved this, but now security expection is coming, eventhough i didnot access any system properties.
Does applet work well with MAC if the applet is coming from a remote system ? Or is this a bug ?
I would be really thankful if somebody could tell me how to view online applets on Mac OS.
Thanks in Advance
Amalan A. Philip
you could personally contact me at:
[email protected]
[email protected]
Hi Mr.danperkins ,
I am posting the applet as well as the frame's code
Applet:test.java
~~~~~~~~~~~~~~~~
import java.applet.*;
import java.awt.*;
public class test extends Applet
public void init()
setBackground(Color.yellow);
setSize(100,100);
//String regid=getParameter("RegId");
System.out.println("Applet initialization");
Zousho z = new Zousho("HardcodeValue");
z.setVisible(true);
Frame:Zousho.java
~~~~~~~~~~~~~~~~~
import java.awt.*;
public class Zousho extends Frame
String regs = null;
public Zousho(String reg)
regs =reg;
setBackground(Color.white);
setSize(400,400);
public void paint(Graphics g)
if(regs!=null)
g.drawString(regs,10,50);
Html:Act.html
~~~~~~~~~~~~~
<html>
<body background="green">
<b>This is the latest Html file</b>
<h1>applet code here</h1>
<applet code="test.class" width="50" height="50"></applet>
</body>
</html>
is this a Problem with Cache ??
I have one more doubt about MacOS. Where does Mac Store its Temporary Internet Files ?
Does this has error has something do with the Internet Cache ?
I checked /Mac hdd/System Folder/Preferences/MS Internet Cache/cache.waf. Is this the only
file which is getting when an url is entered in IE ? Or is there someother location in
mac that is storing the html, class files and images ? If in windows, the class files are
downloaded to the the "temporary internet files" and then get executed on the client
html, then the cache might be also a problem.
Just Ignore this if the internet cache has nothing to do with applet display !!
with regards
Amalan A. Philip
Similar Messages
-
PopupMenu displayed incorrectly in applet on Mac 9.2 and Netscape 7.02
Hi All,
I am running an applet on Mac OS 9.2 with Netscape 7.02 (with default jvm, no additional plug-in installed).
The applet contains menubar with 5 Menus (implemented using PopupMenu) options. The diffrent menus are File, Edit, Zoom, Transform and Help, with diffrent menu-items added to them.
When any of the menus is selected for the first time the contents of Zoom menu pops up (even if user clicks on File or Edit etc). This happens only for the first time. From second time onwards no such problem repeates.
The code has been checked thoroughly and various changes done, but the problem could not be solved.
Has anyone come across similar problem? Is there any solution for the specified problem?
Thanx & Regards,
CharuIt would be nice to see the sources...
Usually, people don't use PopupMenu for implementing menus in menu bar - they use JMenu for this. Did you try that? Or do you use JMenu and still have problems? -
Running a Java Applet on Mac OS browser
I'm having trouble getting my Java Applet to work properly on the Mac OS version of IE5. Basicaly, the app fails to appear. Are there any do's and don'ts regarding the running of Java Applets on Mac Browsers?
I read somewhere that you can't send parameters through to the Applet. Is that true? I'm not trying to do this and it's still doesn't work.
Any help would be appreciated.If anyone can help me with this problem I would be greatful.
-
Hello. There was a problem in applet under Mac OS. The problem is that if I call the dialog from an applet, then close the dialog applet does not receive the focus and have to again click on the applet.
What can I do? Or should we write AppleScript applet to transfer the focus after the dialog is closedOracle does not provide JRE for Mac OS X (at this moment).
It may work better if you ask for advice on Apple's Java forum. -
hi there,
I am a student at the University of Portsmouth in the UK in my third and last year. I am doing my dissertation as a game using applets for a client at the university of which there consits four prototypes. One of the main specification points is that it should work on an apple mac, therefore I am using Swing applets. however with my first prototype it works fine on windows in windows Explorer, firefox and Netscape but i cant get it to work on Mac os 9 or X even with the latest version of java installed on the machine. Can anyone tell me why this is so, I would be very gratefull.
As I cant post the whole applet here as a file download I will just put some code snippets of the main program classes.
Applet ------------------------------
* Class JugglingBalls - A sub class of JApplet that combines the GameInterface and GamePanel into a single application
* @author (Liam Morren)
* @version (v1.0)
import java.awt.*;
import javax.swing.*;
public class JugglingBalls extends JApplet
// instance variables -----------------------------------------------------------------------------------------------------------------------------------
private GamePanel gamePanel; // The game panel including game and render loop
private GameInterface gameInterface; // The swing interface to modify the game scene components
// JApplet methods -------------------------------------------------------------------------------------------------------------------------------------
* Called by the browser or applet viewer to inform this JApplet that it
* has been loaded into the system. It is always called before the first
* time that the start method is called.
public void init()
gamePanel = new GamePanel();
gameInterface = new GameInterface(gamePanel.getGameScene());
Container content = getContentPane(); // The container for components in the applet
setLayout(new BoxLayout(content, BoxLayout.X_AXIS));
content.add(gamePanel);
content.add(gameInterface);
* Returns information about this applet.
* An applet should override this method to return a String containing
* information about the author, version, and copyright of the JApplet.
* @return a String representation of information about this JApplet
public String getAppletInfo()
// provide information about the applet
return "Title: JugglingBalls \nAuthor: Liam Morren \nA simple application showing balls juggling in the air.";
Interface -------------------------------------
* Class GameInterface - Lets you manipulate the game components using swing components
* @author (Liam Morren)
* @version (v1.0)
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.event.*;
public class GameInterface extends JPanel
// instance variables -------------------------------------------------------------------------------------------------------------------------------------
private GameScene gameScene; // Reference to the game scene
private JTabbedPane gameTabs; // Tabs for Game, Balls and Background
// Scene panel
JButton pause, start, reset; // Buttons
// Balls panel
JRadioButton redBall, greenBall, blueBall, archBall, figureOfEightBall; // Radio buttons
JCheckBox canSplit; // Check box
JComboBox setAllPaths, setAllTypes, newBall, selectBall; // Drop down boxes
JButton deleteBall; // Button
Ball currentBall; // Current ball being changed
// Background panel
JRadioButton black, white, red, green, blue, hide, show, stop, move, arch, figureOfEight; // Radio buttons
// Constructors -------------------------------------------------------------------------------------------------------------------------------------------
* Constructor for objects of class GameInterface
public GameInterface(GameScene gameSceneIn)
gameScene = gameSceneIn; // Reference to the game scene
gameTabs = new JTabbedPane(); // JTabbedPane to hold different toolbars
gameTabs.setPreferredSize(new Dimension(200, 494)); // Set the preffered size for the tabbed pane
currentBall = gameScene.getBall(0); // First ball
// Add the panels to the tabbed pane
gameTabs.addTab("Scene", makeScenePanel());
gameTabs.addTab("Balls", makeBallsPanel());
gameTabs.addTab("Background", makeBackgroundPanel());
add(gameTabs); // Add the tab to the game interface panel
setPreferredSize(new Dimension(200, 200));
// Other methods ------------------------------------------------------------------------------------------------------------------------------------------
* makeScenePanel
* @return JPanel - The scene panel with buttons added
private JPanel makeScenePanel()
// Make scene panel
JPanel scenePanel = new JPanel();
scenePanel.setLayout(new BoxLayout(scenePanel, BoxLayout.Y_AXIS)); // Change layout
pause = new JButton("Pause"); // Make buttons
start = new JButton("Start");
reset = new JButton("Reset");
// Add button actions
pause.addActionListener(new ActionListener() // Add button listener to pause button
public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
gameScene.setPaused(true); // Pause game
start.addActionListener(new ActionListener() // Add button listener to start button
public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
gameScene.setPaused(false); // Unpause game
reset.addActionListener(new ActionListener() // Add button listener to reset button
public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
gameScene.reset(); // Reset game
updateSelectBallComboBox();
changeSelectedBall(0);
scenePanel.add(pause); // Add buttons to scene panel
scenePanel.add(start);
scenePanel.add(reset);
return scenePanel;
* makeBackgroundPanel
* @return JPanel - The background panel with buttons added
private JPanel makeBackgroundPanel()
// Make scene panel
JPanel backgroundPanel = new JPanel();
backgroundPanel.setLayout(new GridLayout(5, 1, 2, 2)); // Change layout
// Make buttons
// background colour buttons
JPanel backgroundcolour = new JPanel(); // Change backgroundcolour panel
backgroundcolour.setBorder(BorderFactory.createLineBorder(Color.black));
black = new JRadioButton("Black"); // Radio buttons to change colour
white = new JRadioButton("white");
black.setSelected(true); // Set black as already selected
ButtonGroup backColourGroup = new ButtonGroup(); // Group buttons so only one can be pressed at a time
backColourGroup.add(black); // Add buttons to group
backColourGroup.add(white);
backgroundcolour.setLayout(new GridLayout(2, 2, 0, 0)); // Change layout
backgroundcolour.add(new JLabel("Background colour")); // Add label
backgroundcolour.add(black); // Add buttons to colours panel
backgroundcolour.add(white);
// Add radio button actions
black.addActionListener(new ActionListener() // Add button listener to black button
public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
gameScene.setBackgroundColour(false); // Background colour = black
white.addActionListener(new ActionListener() // Add button listener to white button
public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
gameScene.setBackgroundColour(true); // Background colour = white
// colour buttons
JPanel colours = new JPanel(); // Change colours panel
colours.setBorder(BorderFactory.createLineBorder(Color.black));
red = new JRadioButton("Red"); // Radio buttons to change colour
green = new JRadioButton("Green");
green.setSelected(true); // Set green as already selected
blue = new JRadioButton("Blue");
ButtonGroup colourGroup = new ButtonGroup(); // Group buttons so only one can be pressed at a time
colourGroup.add(red); // Add buttons to group
colourGroup.add(green);
colourGroup.add(blue);
colours.setLayout(new GridLayout(2, 2, 0, 0)); // Change layout
colours.add(new JLabel("Change colours")); // Add label
colours.add(red); // Add buttons to colours panel
colours.add(green);
colours.add(blue);
// Add radio button actions
red.addActionListener(new ActionListener() // Add button listener to red button
public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
if (gameScene.getBackgroundEffect().getColour() != 0)
gameScene.getBackgroundEffect().setColour(0); // Background effect colour = red
green.addActionListener(new ActionListener() // Add button listener to green button
public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
if (gameScene.getBackgroundEffect().getColour() != 1)
gameScene.getBackgroundEffect().setColour(1); // Background effect colour = green
blue.addActionListener(new ActionListener() // Add button listener to blue button
public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
if (gameScene.getBackgroundEffect().getColour() != 2)
gameScene.getBackgroundEffect().setColour(2); // Background effect colour = blue
// hide buttons
JPanel hideShow = new JPanel(); // Change hideShow panel
hideShow.setBorder(BorderFactory.createLineBorder(Color.black));
hide = new JRadioButton("Hide"); // Radio buttons to hide show
show = new JRadioButton("Show");
show.setSelected(true); // Set show as already selected
ButtonGroup hideShowGroup = new ButtonGroup(); // Group buttons so only one can be pressed at a time
hideShowGroup.add(hide); // Add buttons to group
hideShowGroup.add(show);
hideShow.setLayout(new GridLayout(2, 2, 0, 0)); // Change layout
hideShow.add(new JLabel("Hide / Show")); // Add label
hideShow.add(hide); // Add buttons to hideShow panel
hideShow.add(show);
// Add radio button actions
hide.addActionListener(new ActionListener() // Add button listener to hide button
public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
gameScene.getBackgroundEffect().hide(); // Hide
show.addActionListener(new ActionListener() // Add button listener to show button
public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
gameScene.getBackgroundEffect().unHide(); // Unhide
// stopMove buttons
JPanel stopMove = new JPanel(); // Change StopMove panel
stopMove.setBorder(BorderFactory.createLineBorder(Color.black));
stop = new JRadioButton("Stop"); // Radio buttons to stop move
move = new JRadioButton("Move");
stop.setSelected(true); // Set stop as already selected
ButtonGroup stopMoveGroup = new ButtonGroup(); // Group buttons so only one can be pressed at a time
stopMoveGroup.add(stop); // Add buttons to group
stopMoveGroup.add(move);
stopMove.setLayout(new GridLayout(2, 2, 0, 0)); // Change layout
stopMove.add(new JLabel("Stop / Move")); // Add label
stopMove.add(stop); // Add buttons to stopMove panel
stopMove.add(move);
// Add radio button actions
stop.addActionListener(new ActionListener() // Add button listener to stop button
public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
gameScene.getBackgroundEffect().setMove(false); // stop
move.addActionListener(new ActionListener() // Add button listener to move button
public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
gameScene.getBackgroundEffect().setMove(true); // move
// changePath buttons
JPanel changePath = new JPanel(); // Change changePath panel
changePath.setBorder(BorderFactory.createLineBorder(Color.black));
arch = new JRadioButton("Arch"); // Radio buttons to change path
figureOfEight = new JRadioButton("Figure of eight");
arch.setSelected(true); // Set stop as already selected
ButtonGroup changePathGroup = new ButtonGroup(); // Group buttons so only one can be pressed at a time
changePathGroup.add(arch); // Add buttons to group
changePathGroup.add(figureOfEight);
changePath.setLayout(new GridLayout(2, 2, 0, 0)); // Change layout
changePath.add(new JLabel("Change Path")); // Add label
changePath.add(arch); // Add buttons to changePath panel
changePath.add(figureOfEight);
// Add radio button actions
arch.addActionListener(new ActionListener() // Add button listener to arch button
public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
gameScene.getBackgroundEffect().setPath(new Arch()); // Arch
figureOfEight.addActionListener(new ActionListener() // Add button listener to figureOfEight button
public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
gameScene.getBackgroundEffect().setPath(new FigureOfEight()); // Figure of eight
// Add components to background panel
backgroundPanel.add(backgroundcolour);
backgroundPanel.add(colours);
backgroundPanel.add(hideShow);
backgroundPanel.add(stopMove);
backgroundPanel.add(changePath);
return backgroundPanel;
* makeBallsPanel
* @return JPanel - The ball panel with buttons added
private JPanel makeBallsPanel()
// Make balls panel
JPanel ballsPanel = new JPanel();
ballsPanel.setLayout(new BoxLayout(ballsPanel, BoxLayout.Y_AXIS)); // Change layout
// Make buttons
// set all drop down boxes
JPanel setAll = new JPanel(); // Set all panel
setAll.setBorder(BorderFactory.createLineBorder(Color.black));
String[] setAllPathsChoices = {"Arch", "Figure of eight"}; // Selections for set all paths
setAllPaths = new JComboBox(setAllPathsChoices); // Add selections to combo box
String[] setAllTypesChoices = {"Primary ball", "Pastel ball", "3D ball", "Image ball"}; // Selections for set all types
setAllTypes = new JComboBox(setAllTypesChoices); // Add selections to combo box
setAll.add(new JLabel("Set all paths")); // Add combo boxes to set all panel
setAll.add(setAllPaths);
setAll.add(new JLabel("Set all types"));
setAll.add(setAllTypes);
// Add combo box actions
setAllPaths.addActionListener(new ActionListener() // Add selection listener to set all paths combo box
public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
if (setAllPaths.getSelectedItem() == "Arch")
gameScene.setAllPathsArch();
else
gameScene.setAllPathsFigureOfEight();
setAllTypes.addActionListener(new ActionListener() // Add selection listener to set all types combo box
public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
if (setAllTypes.getSelectedItem() == "Primary ball")
gameScene.setAllTypesPrimaryBall();
else if (setAllTypes.getSelectedItem() == "Pastel ball")
gameScene.setAllTypesPastelBall();
else if (setAllTypes.getSelectedItem() == "Image ball")
gameScene.setAllTypesImageBall();
else
gameScene.setAllTypesBall3D();
// new ball drop down box
JPanel newBallPanel = new JPanel(); // new ball panel
newBallPanel.setBorder(BorderFactory.createLineBorder(Color.black));
String[] newType = {"Primary ball", "Pastel ball", "3D ball", "Image ball"}; // Selections for new ball
newBall = new JComboBox(newType); // Add selections to combo box
newBallPanel.add(new JLabel("New ball")); // Add combo boxes to new ball panel
newBallPanel.add(newBall);
// Add combo box actions
newBall.addActionListener(new ActionListener() // Add selection listener to newBall combo box
public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
String ballType = (String) newBall.getSelectedItem();
if (ballType == "Primary ball")
gameScene.addBall(new PrimaryBall(gameScene));
else if (ballType == "Pastel ball")
gameScene.addBall(new PastelBall(gameScene));
else if (ballType == "Image ball")
gameScene.addBall(new ImageBall(gameScene));
else
gameScene.addBall(new Ball3D(gameScene));
updateSelectBallComboBox();
changeSelectedBall(gameScene.getBalls().size() - 1); // Update interface to show new ball
// selected ball panel
JPanel selectedBallPanel = new JPanel(); // selected ball panel
selectedBallPanel.setBorder(BorderFactory.createLineBorder(Color.black));
// Select ball
selectBall = new JComboBox(gameScene.getBallList()); // Add ball list to the select drop down box
deleteBall = new JButton("DeleteBall"); // Delete button
// Ball colour
redBall = new JRadioButton("Red"); // Red choice
redBall.setSelected(true); // Start as selected
greenBall = new JRadioButton("Green"); // Green choice
blueBall = new JRadioButton("Blue"); // Blue choice
ButtonGroup ballColour = new ButtonGroup(); // So only one colour can be selected at a tim
ballColour.add(redBall);
ballColour.add(greenBall);
ballColour.add(blueBall);
// Path
archBall = new JRadioButton("Arch"); // Arch path choice
archBall.setSelected(true); // Start as selected
figureOfEightBall = new JRadioButton("Figure of eight"); // Figure of eight path choice
ButtonGroup ballPath = new ButtonGroup(); // So only one path can be selected at a tim
ballPath.add(archBall);
ballPath.add(figureOfEightBall);
// Can split
canSplit = new JCheckBox("Can split", false); // Initialy not selected
selectedBallPanel.add(new JLabel("Select ball")); // Add components to selected ball panel
selectedBallPanel.add(selectBall);
selectedBallPanel.add(deleteBall);
selectedBallPanel.add(new JLabel("Ball colour"));
selectedBallPanel.add(redBall);
selectedBallPanel.add(greenBall);
selectedBallPanel.add(blueBall);
selectedBallPanel.add(new JLabel("Path"));
selectedBallPanel.add(archBall);
selectedBallPanel.add(figureOfEightBall);
selectedBallPanel.add(canSplit);
// Add select ball drop down box action
selectBall.addActionListener(new ActionListener() // Add selection listener to selectBall combo box
public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
changeSelectedBall(selectBall.getSelectedIndex()); // Change the selected ball using the index from the select ball drop down box
// Add delete button action
deleteBall.addActionListener(new ActionListener() // Add selection listener to deleteBall button
public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
int tempIndex = selectBall.getSelectedIndex(); // Temp index
if (gameScene.getBalls().size() > 1) // If there is more than 1 ball left
gameScene.removeBall(tempIndex); // Remove ball
updateSelectBallComboBox(); // Update with new ball list
changeSelectedBall(tempIndex - 1); // Update interface with new current selected ball
// Add radio button colour actions
redBall.addActionListener(new ActionListener() // Add button listener to redBall button
public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
if (currentBall.getColour() != 0)
currentBall.setColour(0); // currentBall colour = red
greenBall.addActionListener(new ActionListener() // Add button listener to greenBall button
public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
if (currentBall.getColour() != 1)
currentBall.setColour(1); // currentBall colour = green
blueBall.addActionListener(new ActionListener() // Add button listener to blueBall button
public void actionPerformed(ActionEvent ev) // Background colour = blue
if (currentBall.getColour() != 2)
currentBall.setColour(2); // currentBall colour = blue
// Add path radio button actions
archBall.addActionListener(new ActionListener() // Add button listener to arch button
public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
currentBall.setPath(new Arch()); // Arch
figureOfEightBall.addActionListener(new ActionListener() // Add button listener to figureOfEight button
public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
currentBall.setPath(new FigureOfEight()); // Figure of eight
// Add can split check button actions
canSplit.addActionListener(new ActionListener() // Add button listener to can split
public void actionPerformed(ActionEvent ev) // Overide actionPerformed() method
currentBall.setCanGiveBirth(canSplit.isSelected()); // Ball can split if can split check button is selected
// Add components to ball panel
ballsPanel.add(setAll);
ballsPanel.add(newBallPanel);
ballsPanel.add(selectedBallPanel);
return ballsPanel;
* changeSelectedBall
* @param ballIndexIn - The numbered index of the ball in the game scene list of balls. If less than 0 then equals 0. If more than ball list size then equals last ball
public void changeSelectedBall(int ballIndexIn)
if (ballIndexIn < 0) // Make sure index is within bounds
ballIndexIn = 0;
else if (ballIndexIn >= gameScene.getBalls().size())
ballIndexIn = gameScene.getBalls().size() - 1; // Else put within bounds at either end
currentBall.highlight(false); // Unhighlight current ball
currentBall = gameScene.getBall(ballIndexIn); // Get new current ball
currentBall.highlight(true); // Highlight new current ball
// Update controls to new ball
selectBall.setSelectedIndex(ballIndexIn);
switch (currentBall.getColour()) // Update colour controls
case 0: redBall.setSelected(true); break;
case 1: greenBall.setSelected(true); break;
default: blueBall.setSelected(true); break;
if (currentBall.getPath() instanceof Arch) // If path is arch
archBall.setSelected(true); // Update controls as arch
else
figureOfEightBall.setSelected(true); // Else figure of eight
canSplit.setSelected(currentBall.canGiveBirth()); // Set if the ball can split or not
* updateSelectBallComboBox
* This method updates the combo box selection model with a new one made from the updated balls arraylist from the game scene
public void updateSelectBallComboBox()
DefaultComboBoxModel model = new DefaultComboBoxModel(gameScene.getBallList());
selectBall.setModel(model);
}Kind regards
Liam morrenhttp://docs.info.apple.com/article.html?artnum=301073
This link states Mac OS X 10.4 now supports Java 5.0. It does mention nothing about Mac OS 9 or previous version of OS X. The problem you may be facing is that your Mac is running only 1.4.2 or less. The class files compiled for Java 5.0 can't run in non 5.0 versions of the Java Virtual Machine. Java 5.0 was a major release for the Java language and thus the change in numbering (though it took a little bit for this to change).
Anyway you should confirm what version of Java you have installed on your Mac.
At a command prompt:
java -version
The above URL states that the previous 1.4.2 Java version is not uninstalled, and this could still be the preferred version to use for Java applications even after installing Java 5.0.
The URL above states there is a utility to set your apps to use Java 5.0 as the perferred Java version. Who knows maybe this is all you need to do. I hope this is the case, then it probably is an easy fix, otherwise you may need to rewrite your app in Java 1.4.2 to get it to run on your version of Mac. -
Can't run applet after mac os x upgrade
hello,
I have trouble running a simple java applet on my mac os X laptop .ie:double click on jar file, opens up but nothing happens
The problem started when I upgraded my laptop to 10.2.5
[c18339:~] fred% java -version
java version "1.4.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-39)
Java HotSpot(TM) Client VM (build 1.4.1_01-14, mixed mode)
The error message when i try to run the applet:
fred% java -jar mindterm.jar
2003-05-18 08:57:57.295 java[898] Font 04b-20: descent is 0.
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.mindbright.application.MindTerm.initGUI(Unknown Source)
at com.mindbright.application.MindTerm.run(Unknown Source)
at com.mindbright.application.MindTerm.main(Unknown Source)
Caused by: java.lang.NullPointerException
at sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(SunGraphicsEnvironment.java:327)
at sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(SunGraphicsEnvironment.java:359)
at apple.awt.CToolkit.getFontList(CToolkit.java:901)
at com.mindbright.terminal.o.a(Unknown Source)
at com.mindbright.terminal.o.do(Unknown Source)
at com.mindbright.terminal.o.<clinit>(Unknown Source)
... 3 more
Is there something wrong with Java shipped with 10.2.5, it was working
great on 10.1
regards
frederic
http://www.dab.uts.edu.auJust a guess, but did the applet come with any fonts?
-
Safari will not run a signed applet on mac os x 10.5.7 with new Java update
Hi Everyone,
I've got a problem that hopefully you guys can help me solve. I have an applet that runs on windows, mac and linux that is signed by a verisign certificate my work has. The certificate is valid and everything works just fine on windows and linux, but after I upgraded our macs with the newest java update for mac (which gave macs Java 1.6.13), the applets won't work. When the applet is loaded in Safari or Firefox, it asks if I want to trust the certificate. When I tell it to trust it, Safari comes back with a message saying that it will not trust the code and will treat it as unsigned code.
For a long time the applet was built and signed on windows, but now it can be built and signed on windows and mac. Building and signing on either platform gives the same results and the mac signed applet works just fine on windows.
Has anyone else run across this problem? Any help or advice will be appreciated.
Thanks,
RobbieBenGlancy wrote:
How did you tell it to fully trust it? I thought the dialog comes up asking the user whether to trust it.
I only ask because it's not practical to expect all users to dig around for settings to trust a particular certificate.They don't have to dig around. When a signed Applet is loaded, if the certificate chain contains a certificate not in the trust store then a dialogue box asks the user if he wants to run it anyway. This dialogue box also has check box to indicate the the user should always trust this certificate and checking this means the user will not be asked again. -
I have a Swing applet and I deployed it in weblogic 6.1, when I access this in Mac os 9 , it gives the Applet error : closing in browser.
Appart from installing MRJ2.2.5((latest?) and swingall.jar(jfc) ,
what are the other necessary steps to get the VM running properly in this environment.
But Apple's MRJ site states(http://developer.apple.com/java/download.html),
New features introduced since MRJ 2.2 include:
Full JFC Swing Support.
Can a Mac expert out there give me an answer to whether or not a Mac OS 9 user can run an applet that uses Swing components.
Please help.
Thanks
VinodAs per my knowledge, u can use JJEdit editor on MAC OS X. By using this editor, you can run the applets. Here I am using JJEdit as a java editor on MAC OS X. just dowload the JJEdit. and run the applet on it.
regards
nr konjeti -
Hi,
I have a program as an applet (rather than JApplet for backward compatability on the mac), and i am debugging it on the macintosh. the applet contains a panel with a card layout, this has a panel as a menu and another panel which is a game that i have overridden the paint method to update graphics.
The problem is is that the size is supposed to be 500 by 500 but whenever i run it always paints at about 30 by 60, no matter what size(), bounds() or location() i set. It is always set to the center aswell.
I have made it using all swing components and it works fine, but my specification says it should be on a mac. Because of this i have had to change all components to old awt components, the functionallity seems to work, but painting is buggered.
any ideas?
chersFixed it now, just put layout manager as null
-
hello,
can anyone tell me whether sun provides ( i could not find one) or apple has provided plugins to run applets in IE for Mac or Netscape for Mac.
thanx in advance
prithviHello privthim;
You might want to take a look at this page:
http://java.sun.com/docs/books/tutorial/getStarted/cupojava/mac.html#3
Under the first section (Checklist), you are provided wih links to the Macintosh Runtime Environment for Java Software Development Kit, the Macintosh Runtime Enviroment for Java (MRJ), etc...
Hope this helps! -
Loading problem for Signed applet on MAC OS
Hi All
I�m trying to test my application on MAC OS (For versions: 10.2.6 as well as 10.4.x)
For MAC 10.2.6 OS Java version is 1.4.1_01 and
For MAC 10.4.x OS Java version is 1.4.2_07
The code is compiled on Windows machine having Java version 1.4.2_07
There�s a functionality which is calling signed applet (signed JAR for applet) and when this functionality is called, following error encounters:
Java(TM) Plug-in: Version 1.4.1_01
Using JRE version 1.4.1_01 Java HotSpot(TM) Client VM
java.io.IOException: Server returned HTTP response code: 403 for URL: http://myMachineName: port/appName/UploadDownloadAppletJava.jar
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:709)
at sun.plugin.net.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:384)
at sun.plugin.net.protocol.http.HttpUtils.followRedirects(HttpUtils.java:39)
at sun.plugin.cache.CachedJarLoader.download(CachedJarLoader.java:302)
at sun.plugin.cache.CachedJarLoader.load(CachedJarLoader.java:128)
at sun.plugin.cache.JarCache.get(JarCache.java:172)
at sun.plugin.net.protocol.jar.CachedJarURLConnection.connect(CachedJarURLConnection.java:93)
at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFile(CachedJarURLConnection.java:78)
at sun.misc.URLClassPath$JarLoader.getJarFile(URLClassPath.java:580)
at sun.misc.URLClassPath$JarLoader.<init>(URLClassPath.java:541)
at sun.misc.URLClassPath$3.run(URLClassPath.java:319)
at java.security.AccessController.doPrivileged(Native Method)
at sun.misc.URLClassPath.getLoader(URLClassPath.java:308)
at sun.misc.URLClassPath.getLoader(URLClassPath.java:285)
at sun.misc.URLClassPath.getResource(URLClassPath.java:155)
at java.net.URLClassLoader$1.run(URLClassLoader.java:190)
at java.security.AccessController.doPrivileged(Native Method)
Due to which cannot access Applet class (which is inside UploadDownloadAppletJava.jar) and operation is failed.
(It works perfectly fine on Windows XP with both IE 6 and Firefox browsers).
On MAC I'm testing on FireFox.
Code which calls to applet is:
<applet
name=UploadDownloadApplet
code="UploadDownloadApplet.class"
codebase=/appName/
archive=UploadDownloadAppletJava.jar
width=0 height=0>
<PARAM NAME=cabbase VALUE=UploadDownloadApplet.cab>
<PARAM NAME=action VALUE=<%= action %>>
<PARAM NAME=workingAreaMac VALUE="<%= workingAreaMac %>">
<PARAM NAME=workingAreaPC VALUE="<%= workingAreaPC %>">
<PARAM NAME=processId VALUE=<%= processId %>>
<PARAM NAME=downloadBaseProductInd VALUE=<%= downloadBaseProductInd %>>
<PARAM NAME=initTime VALUE=<%= initTime %>>
<PARAM NAME=httpSessionId VALUE="<%= httpSessionId %>">
<PARAM NAME=userId VALUE="<%= userId %>">
</applet>
Please suggest some guidelinesjava.io.IOException: Server returned HTTP response code: 403 for URL:
http://myMachineName: port/appName/UploadDownloadAppletJava.jar
Have you tried entering the URL into a browser window and see what happens?
Message was edited by:
wangwj -
How to update a textarea from an applet on Mac OS
Hi, i'm writing an applet and I would like to update a textarea, of the same html page, from my applet.
I'm working on MAC OS (LiveConnect doesn't work).
I've tried the solution that i've found at this address: http://www.rgagnon.com/ce/java-js.html, but the data are transmitted via the url (by means of the GET method) and i've too much data to move.
I would appreciate any help.Your applet can open an URLConnection and read directly a document from your webserver.
public String readText() {
java.net.HttpURLConnection conn = (java.net.HttpURLConnection)myURL.openConnection(); ...
}So using JavaScript on your page, you might call readText() to fill that textarea.
The interesting link you gave, handled the JavaScript/Applet interaction. Test that with just return "Hello";.
The real programming is more interesting. -
Hi all,
I'm currently working on applet that is running well in a windows environment (using different versions of the Sun JRE). Now, I'd like to have this applet also being available to mac users (safari browser - sun jre for mac).
The applet is relatively simple : it is running in the background and pops up when called by the javascript when the application needs the password from the user (it's pki app, signed for filesystem access).
The applet loads correctly but it seems to have a problem to display the AWT dialog box and more precisely it seems to freeze when the showDialog method that afterwards creates the awt frame and draws it, is called.
To get rid of it, the browser must be closed.
It looks like a deadlock or a thread priority problem, as if the awt thread can't go on...
Did anyone experience the problem once ?
For your info, when my applet starts, I'm starting another thread (say t2) to make my methods callable from the javascript. It's a signed applet, and Sun recently changed the policy regarding applet-javascript communication (briefly stated, threads in applet initiated by a javascript call, don't have the privileges to perform sensitive operations (among others, file acces...) anymore. So my main thread actually delegates its work to the second thread I created (t2) (more info somewhere on this forum)
Could that be linked to the problem ? It's working correctly on windows, however.
Thanks for your help.
ADThe JRE for Mac OS X is available from Apple via the program Software Updates. Trying running the program and obtaining the most recent version available which should be 1.4.2. What version are you using now..
And if you could post some code, whatever snippet from the original is relevant to the problem, that would help others to help you. Someone could try to reproduce the effect on their own machine that way. Just a thought. -
Applet on mac...
Hi.
I am having trouble with my applet when I access my site from a mac.
Opera for mac runs the applet, but it will not work.
the applet is a menu. It shows up, look the way it does on several browser on a widows machine. But it doesn't work. It is basicly just javascript calls, so I don't get way it don't work?? Cause I use a javascript to open a new window (window.open()) in which to show the applet. And the log out function is just a parent.close() which every where else closes the window again... but not on mac.
HELP!If javascript don't work why post it at a java forum???
Going from the info you posted the only conclusion I can come to is that you must have
done something wrong. I know it's not much but I don't have much to go on.
As for javascript to java and vica versa anything short of re programming the plugin won't
solve the problems you got.
http://www.google.nl/search?hl=nl&biw=1278&q=site%3Asun.com+mac+OSX+applet+javascript&btnG=Zoeken&meta= -
How to transmit data from textarea-HTML to an Applet on MAC OS
Hi, i'm writing an applet and I would like to use in my applet the data coming from a textarea of the same html page and at the end of my applet, i want to update this textarea.
I'm working on MAC OS (LiveConnect doesn't work).
Java-Javascript :
I've tried the system of invisible frame with javascript that i've found at this address: http://www.rgagnon.com/ce/java-js.html, but the data are transmitted via the url (by means of the get method) and i've too much data to move. I've tried to post the data to a cgi script and i've used the showDocument method but i can't get the data that i've posted.
Javascript-Java :
I've tried the solution given at the same address but it doesn't work at all because : 1) the method getDocumentBase() doesn't gives the parameters 2) it still uses the get method.
I would appreciate any help.If i include the textarea in my applet, I'll have many web sites (which are already working with an embedded texarea) to update.
and to be very accurate, the textarea is in another page and my applet is "alone" in a pop-up window.
Maybe you are looking for
-
Dumping data from forms 4.5 to excel
Hi, we use oracle 8.1.3 (WINDOWS 2000) / forms 4.5 (WINDOWS 98). we call a procedure from forms 4.5 to dump oracle data into excel file. The procedure is working fine. The problem is after dumping data into excel file and exiting the program, excel i
-
I have bought my first iPad and I am having a problem getting my photos from my PC to my iPad. When I pick the album I want to put on my iPad it gives me an message saying ( Are you sure want to remove all applications from the iPad? This will delete
-
Applicatio​n task manager
Am trying to download application task manager but once I go to application world am being told that there is no app task manager for my phone.Am using 8520
-
Configurator crashes when importing apps
configurator crashes when importing apps
-
[SOLVED]Cannot get panel script to load(bspwm)
Hi all, I am new to arch linux and just started using bspwm, have used xmonad for a few months or so. I am trying to base my desktop on windelicato's config (which is incredible imo and you can see it at his github) but am having trouble using the sc