Calculator applet using swing

please Help!!!!!
This thing keeps giving a Null Pointer Exception whenever you click a button it compiles fine and runs ok until a button is clicked.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class MyCalculator extends JApplet implements ActionListener {
private char op = 0;
private float num1 = 0, num2 = 0, value = 0 ;
private boolean clearNext = false;
private JTextField display, textField2;
private JButton buttonEq, buttonPlus, buttonMinus, buttonMult,buttonCos;
private JButton buttonDiv,buttonPlusMinus,buttonDec,buttonC,buttonSin;
private JButton buttonTan;
private JButton button = new JButton();
private boolean start = true;
// create GUI components
public void init() {
Container con = getContentPane();
con.setLayout( new BorderLayout());
con.setBackground(Color.darkGray);
//add display display
JTextField display = new JTextField( "0", 15 );
display.setBackground(Color.black);
display.setForeground(Color.red);
display.setEditable(false);
JTextField textField2 = new JTextField( " Design and Implementation By Erwin Zeitner" );
textField2.setBackground(Color.black);
textField2.setForeground(Color.red);
textField2.setEditable(false);
//create numbered buttons
JButton button0 = new JButton("0" );
button0.setBackground(Color.blue);
JButton button1 = new JButton( "1" );
button1.setBackground(Color.blue);
JButton button2 = new JButton( "2" );
button2.setBackground(Color.blue);
JButton button3 = new JButton( "3" );
button3.setBackground(Color.blue);
JButton button4 = new JButton( "4" );
button4.setBackground(Color.blue);
JButton button5 = new JButton( "5" );
button5.setBackground(Color.blue);
JButton button6 = new JButton( "6" );
button6.setBackground(Color.blue);
JButton button7 = new JButton( "7" );
button7.setBackground(Color.blue);
JButton button8 = new JButton( "8" );
button8.setBackground(Color.blue);
JButton button9 = new JButton( "9" );
button9.setBackground(Color.blue);
//create function buttons
JButton buttonC = new JButton( "clear" );
buttonC.setBackground(Color.green);
JButton buttonPlus = new JButton( "+" );
buttonPlus.setBackground(Color.green);
JButton buttonMinus = new JButton( "-" );
buttonMinus.setBackground(Color.green);
JButton buttonMult = new JButton( "*" );
buttonMult.setBackground(Color.green);
JButton buttonDiv = new JButton( "/" );
buttonDiv.setBackground(Color.green);
JButton buttonSin = new JButton( "Sin" );
buttonSin.setBackground(Color.green);
JButton buttonCos = new JButton( "Cos" );
buttonCos.setBackground(Color.green);
JButton buttonTan = new JButton( "Tan" );
buttonTan.setBackground(Color.green);
JButton buttonDec = new JButton( "." );
buttonDec.setBackground(Color.blue);
JButton buttonEq = new JButton( "=" );
buttonEq.setBackground(Color.orange);
JButton buttonPlusMinus = new JButton( "+/-" );
buttonPlusMinus.setBackground(Color.blue);
//create a panel for each row
JPanel row1 = new JPanel();
row1.setBackground(Color.darkGray);
JPanel row2 = new JPanel();
row2.setBackground(Color.darkGray);
JPanel row3 = new JPanel();
row3.setBackground(Color.darkGray);
JPanel row4 = new JPanel();
row4.setBackground(Color.darkGray);
JPanel row5 = new JPanel();
row5.setBackground(Color.darkGray);
JPanel row6 = new JPanel();
row6.setBackground(Color.darkGray);
JPanel row7 = new JPanel();
row7.setBackground(Color.darkGray);
//create panel for rows and set layout
JPanel p = new JPanel();
p.setLayout(new GridLayout( 7,1,0,5 ));
p.setBackground(Color.darkGray);
//set layout for rows
GridLayout grid = new GridLayout(1,4,5,0);
//add buttons & display field to rows
row1.setLayout(grid);
row1.add(display);
//add row to panel
p.add(row1);
row2.setLayout(grid);
buttonC.addActionListener(this);
row2.add(buttonC);
buttonSin.addActionListener(this);
row2.add(buttonSin);
buttonCos.addActionListener(this);
row2.add(buttonCos);
buttonTan.addActionListener(this);
row2.add(buttonTan);
//add row to panel
p.add(row2);
row3.setLayout(grid);
button7.addActionListener(this);
row3.add(button7);
button8.addActionListener(this);
row3.add(button8);
button9.addActionListener(this);
row3.add(button9);
buttonPlus.addActionListener(this);
row3.add(buttonPlus);
//add row to panel
p.add(row3);
row4.setLayout(grid);
button4.addActionListener(this);
row4.add(button4);
button5.addActionListener(this);
row4.add(button5);
button6.addActionListener(this);
row4.add(button6);
buttonMinus.addActionListener(this);
row4.add(buttonMinus);
//add row to panel
p.add(row4);
row5.setLayout(grid);
button1.addActionListener(this);
row5.add(button1);
button2.addActionListener(this);
row5.add(button2);
button3.addActionListener(this);
row5.add(button3);
buttonMult.addActionListener(this);
row5.add(buttonMult);
//add row to panel
p.add(row5);
row6.setLayout(grid);
button0.addActionListener(this);
row6.add(button0);
buttonDec.addActionListener(this);
row6.add(buttonDec);
buttonPlusMinus.addActionListener(this);
row6.add(buttonPlusMinus);
buttonDiv.addActionListener(this);
row6.add(buttonDiv);
//add row to panel
p.add(row6);
row7.setLayout(grid);
buttonEq.addActionListener(this);
row7.add(buttonEq);
//add row to panel
p.add(row7);
// add panel and textField2 to the container
con.add(p,BorderLayout.CENTER);
con.add(textField2,BorderLayout.SOUTH);
public void actionPerformed(ActionEvent e) {
String buttonPressed = e.getActionCommand();
try {
if (buttonPressed.equals( "+/-" )) {
value = getValue(display.getText());
value *= -1;
clearOutput();
addToOutput("" + value );
else switch ( buttonPressed.charAt(0) ) {
case '+':
case '-':
case '*':
case '/':
buttonEq.setEnabled(true);
buttonPlus.setEnabled(false);
buttonMinus.setEnabled(false);
buttonMult.setEnabled(false);
buttonDiv.setEnabled(false);
num1 = getValue(display.getText());
op = buttonPressed.charAt(0);
clearNext = true;
break;
case '=':
buttonEq.setEnabled(true);
buttonPlus.setEnabled(true);
buttonMinus.setEnabled(true);
buttonMult.setEnabled(true);
buttonDiv.setEnabled(true);
getResult();
num1 = getValue(display.getText());
op = 0 ;
clearNext = true;
break;
case 'C':
float num1 = getValue(display.getText());
op = buttonPressed.charAt(0);
getResult();
clearNext = false;
break;
case 'S':
num1 = getValue(display.getText());
op = buttonPressed.charAt(0);
getResult();
clearNext = false;
break;
case 'T':
num1 = getValue(display.getText());
op = buttonPressed.charAt(0);
getResult();
clearNext = false;
break;
case 'c':
clearOutput();
op = 0 ;
num1 = (float) 0 ;
break;
default:
if (clearNext) {
clearOutput();
clearNext = false;
addToOutput(buttonPressed);
catch( Exception exception) {
System.err.println(exception.toString());
public void getResult() {
float num2 = getValue(display.getText());
switch (op) {
case '+':
num1 += num2;
break;
case '-':
num1 -= num2;
break;
case '*':
num1 *= num2;
break;
case '/':
if (num2 != 0)
num1 /= num2;
else
num1 = 0;
break;
case 'C':
Math.cos(num1);
break;
case 'S':
Math.sin(num1);
break;
case 'T':
Math.tan(num1);
break;
clearOutput();
addToOutput( "" + num1 );
clearNext = true;
public void addToOutput( String buttonPressed) {
String newOutput = display.getText();
if (buttonPressed.equals(".")) {
if (newOutput.indexOf(".") == -1)
newOutput += ".";
else
newOutput += buttonPressed;
int newLength = newOutput.length();
display.setText(newOutput);
public void clearOutput() {
try{
display.setText( "" );
catch(Exception c) {
System.err.println(c.toString());
public float getValue(String arg) {
if (arg.equals("."))
arg = "0";
Float f = Float.valueOf(arg);
return f.floatValue();

I have found your error please change this to the below one
//add display display
JTextField display = new JTextField( "0", 15 );
display.setBackground(Color.black);
display.setForeground(Color.red);
display.setEditable(false);
//add display display
display = new JTextField( "0", 15 );
display.setBackground(Color.black);
display.setForeground(Color.red);
display.setEditable(false);
if you noticed, you declared the display as a global variable but did not intialized it that is why u get NullPointerException.
By declaring JTextField display again in a method it only belong to that method which is init()
The other textfield also have to be changed if you wish to access it from elsewhere(ex. textfield2 )
Thanks
Joey

Similar Messages

  • Html file to run an Applet using swings in 1.4.1 or 1.3.1

    Can anyone send me an html document to launch the applet in a browser. I have very basic html, but I need one that uses the appropriate plug-in and that has parameters such as height, width, etc. My applet uses tabbed panes, dialog boxes and comboboxes. It works well with appletviewer, but does not work in IE or Netscape.
    Thank you for your help
    here is what I am using which does does show anything but a grey screen
    <HTML>
    <HEAD>
    <TITLE>
    CIS 602 Semister Project
    </TITLE>
    </HEAD>
    <BODY>
    <BR>
    <H3>
    <CENTER>
    Swing
    </CENTER>
    </H3>
    <H3>
    <BR><BR>
    <P><H3>
    <CENTER>
    <BR><BR>
    <P><h2>
    Structured Problem Solving Strategy
    </h2>
    <blockquote>
    <!--"CONVERTED_APPLET"-->
    <!-- CONVERTER VERSION 1.1 -->
    <SCRIPT LANGUAGE="JavaScript"><!--
    var info = navigator.userAgent; var ns = false;
    var ie = (info.indexOf("MSIE") > 0 && info.indexOf("Win") > 0 && info.indexOf("Windows 3.1") < 0);
    //--></SCRIPT>
    <COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!--
    var ns = (navigator.appName.indexOf("Netscape") >= 0 && ((info.indexOf("Win") > 0 && info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0)));
    //--></SCRIPT></COMMENT>
    <SCRIPT LANGUAGE="JavaScript"><!--
    if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = "570" HEIGHT = "500" codebase="http://java.sun.com/products/plugin/1.1.2/jinstall-112-win32.cab#Version=1,1,2,0"><NOEMBED><XMP>');
    else if (_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.4.2" java_CODE = "semiclient.class" WIDTH = "570" HEIGHT = "500" pluginspage="http://java.sun.com/products/plugin/1.1.2/plugin-install.html"><NOEMBED><XMP>');
    //--></SCRIPT>
    <APPLET CODE = "semiclient.class" WIDTH = "570" HEIGHT = "500" ></XMP>
    <PARAM NAME = CODE VALUE = "semiclient.class" >
    <PARAM NAME="type" VALUE="application/x-java-applet;version=1.4.2">
    </APPLET>
    </NOEMBED></EMBED></OBJECT>
    <!--
    <APPLET CODE = "semiclient.class" WIDTH = "570" HEIGHT = "500" >
    </APPLET>
    -->
    <!--"END_CONVERTED_APPLET"-->
    </Center>
    <BLOCKQUOTE><PRE>
    </PRE></BLOCKQUOTE>
    </H3>
    <BLOCKQUOTE><PRE>
    </PRE></BLOCKQUOTE>
    </H3>
    </BODY></HTML>

    Try this:
    <HTML>
    <HEAD>
    <TITLE>CIS 602 Semister Project</TITLE>
    </HEAD>
    <BODY>
    <CENTER><H3>Swing</H3></CENTER><CENTER><H2>Structured Problem Solving Strategy</H2></CENTER>
            <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
                width="750"
                height="575"
                align="baseline"
                codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_4_0-win.cab">
                <PARAM NAME="code"       VALUE="full.qualified.ClassName">
                <PARAM NAME="codebase"   VALUE="path/to/your/class/files/or/archive/">
                <PARAM NAME="archive"    VALUE="nameOfJarWhichContainsClassFiles.jar">
                <PARAM NAME="type"       VALUE="application/x-java-applet;version=1.4">
                <PARAM NAME="scriptable" VALUE="false">
                <COMMENT>
                    <EMBED type="application/x-java-applet;version=1.4"
                        width="750"
                        height="575"
                        align="baseline"
                        code="full.qualified.ClassName"
                        codebase="path/to/your/class/files/or/archive/"
                        archive="nameOfJarWhichContainsClassFiles.jar"
                        pluginspage="http://java.sun.com/products/plugin/1.4/plugin-install.html">
                        <NOEMBED>
                            No Java 2 SDK, Standard Edition v 1.4 support for APPLET!!
                        </noembed>
                    </embed>
                </COMMENT>
            </OBJECT>
    </BODY>
    </HTML>

  • Memory leak with 1.6.0_07 in applet using Swing

    Java Plug-in 1.6.0_07
    Using JRE version 1.6.0_07 Java HotSpot(TM) Client VM
    Windows XP - SP2
    I have a commercial application that has developed a memory leak with the introduction of the latest plugin. The applets chew up memory and eventually freeze. They did not before. Using jvisualm I see a build up of native arrays, primarily int[][] and char[]. I'm still investigating. Anyone have a similar experience?
    The Applet uses a swing interface, uses buffered images and swing timers, and regularly performs http connections to the server which result in actions via the SwingUtil.invokeLater() method.

    I am Using Internet Explorer Browser Version 6.0.Huge security hole.
    Its not throwing Error / Exception Wrap a try/catch at the highest level possible.
    Catch 'Throwable'. And log/display it somewhere.

  • Progress bar on Applet using swing

    Not sure if this is Swing related or applet related, so I'll post it here... :-)
    Long work should be done on a Worker thread an not inside the Swing Dispacher thread .
    So normally I create a Runnable object that calls something like doWork(), and pass the runnable object as a parameter to the Sing utilities invokelater() function.
    My question is inside the worker thread how to update the GUI, in this case the progress bar?
    Can I just call from inside doWork() with no problems the progressbar.setValue(X)?
    Do I need to create another thread and use it too update the UI?
    Is something like this valid ?
    public void doWork() {
    // work work work
    progressbar.setValue(5);
    //more work
    progressbar.setValue(15);
    // and so on
    Thanks for the help!

    Not sure if this is Swing related or applet related,
    so I'll post it here... :-)It's definitely Swing related.
    Long work should be done on a Worker thread an not
    inside the Swing Dispacher thread . This is true.
    So normally I create a Runnable object that calls
    something like doWork(), and pass the runnable object
    as a parameter to the Sing utilities invokelater()
    function.This does not start a worker thread but rather schedules your Runnable object to be run on the EDT.
    My question is inside the worker thread how to update
    the GUI, in this case the progress bar?SwingUtilities or EventQueue have invokeLater and invokeAndWait specifically for this purpose.
    Can I just call from inside doWork() with no problems
    the progressbar.setValue(X)?
    Do I need to create another thread and use it too
    update the UI?No. Here's where you could use invokeLater.
    Is something like this valid ?
    public void doWork() {
    // work work work
    rogressbar.setValue(5);
    //more work
    progressbar.setValue(15);
    // and so onNo.
    >
    Thanks for the help!Like pete has pointed out, this seems to be a job for SwingWorker.

  • Using Swing applet to write data to file on SERVER

    Hello,
    I'm in the process of writing an applet using Swing (SDK v1.4.2). Here's the deal. The JApplet calls a JPanel, which will be used by customers on my site to enter data. I'm adding a <Save> button to the "form" which is supposed to write data to a file on the server (in order to preserve the customer's preferences).
    Please note that I am NOT attempting to write data to the customer's hard disk. That requires digital certificates, etc. which I am trying to avoid for now.
    Instead, I am using the URL class to access the file:
    URL page = new URL("http://www.whatever.com/mycustomers/preferences.txt")
    I then use the URLConnection class to establish the connection:
    URLConnection conn = this.page.openConnection();
    conn.setDoInput(true);
    conn.setDoOutput(true);
    conn.connect();
    etc...
    I've created a text file (preferences.txt) on my web site. Using the classes InputStreamReader, BufferedStreamReader, and StringBuffer, I can successfully read the file into a JOptionPane in my applet.
    The problem comes when I try to write data TO this file. I know the file exists because the applet can read it. I've set the permissions on the file to 666. I've got all of the appropriate syntax within a try statment that catches an IOException. I also have JOptionPanes all over the place to let me know where the program is. I've tried different combinations of output streams like BufferedWriter, BufferedOutputStream, StringWriter, but the file does not get updated. When the applet runs, it does not throw any exceptions, not even when I change the URL from "HTTP://www.whatever.com/prefs.txt" to "HTTP:/www.whatever.com/prefs.txt" (only one slash on HTTP, shouldn't I get a MalformedURLException?)
    I apologize for all the background, but I thought you might need it. The bottom line is:
    1) Can an applet write to a file on a remote server (not local hard disk)?
    2) If so, what (if any) caveats are there?
    3) Is there a way to check for file existence or be able to create a new file?
    4) I'm using the HTTP protocol - is there some restriction that prevents an applet from writing to a file using that protocol? If so, is there a workaround?
    5) Assuming that creating/writing a file using the method I've described is possible, what would be the appropriate output streams to use? (Currently, I'm using OutputStreamWriter with BufferedWriter).
    I've been struggling with this for a while. Any help/suggestions would be appreciated.
    Thanks
    P.S. I also posted this message on the Applet development forum, but I've received no response as of yet.

    Http servers support PUT as a mechanism to upload data to a specified URL. Get on the other hand which is what most people are familiar with is how you retrieve that data. The basic URLConnection is an abstraction of the Http connection which can be used for GET and POST operations by default based on doInput(true|false).. If you which to use any of the http methods other than GET|POST you will have to cast the URLConnection to HttpURLConnection so you can gain access to the specific Http functionaility that could not be abstracted.
    Since you are using a hosting service the chances are that you won't be able to use HTTP PUT on their server. Most servers do not support HTTP PUT without configuring them todo so. Now Apache allows localized config through the .htacess file. It might be possible (keep in mind I am not an apache expert) to configure a particular directory to allow HTTP PUT using this .htacess file it may not be possible. You will have to consult the Apache web server documentation for that answer.
    But regardless you can use the HttpURLConnection and the PUT method to send data from your applet to the server. In fact that is the preferred way to do this. If you can not configure your web server to support that method then you will have to develop a Servlet to do it. A servlet has several methods such as doGet(), doPost(), and doPut(). You would override the doPut() method get the URI path create a file and a FileOutputStream to that file, get from the request the inputstream, possibly skip the http headers, and then write byte for byte the incoming data to your OutputStream until you reach the end at which point you would close the OutputStream and send an Http Response of some sort. Typically in HTTP it would be 200 OK plus some web content. You content can be empty so long as your applet recognizes that is what it should expect...
    And away you go...

  • Problem in loading an applet using JRE 1.5

    Hi,
    I have an applet which is working fine under JRE 1.4, but the same applet failing to load by using JRE 1.5
    Problem Description:
    1. The images in the applet fails to load using JRE 1.5
    2. The Username and Password text box are also failing to initialize.
    Can anyone help me out in this.
    Is there any code changes required ?

    I wonder if you have the same problem as me... Maybe we can find a solution for us both, no need for me to open a new thread for this topic then...
    I wrote an applet using Swing and compiled it using JavaSDK 1.4.x. I also installed the 1.4.x JRE for both of my test browsers. In Mozilla 1.1 the applet displays properly all the time. In IE6 SP1 it sometimes works as intended but sometimes the applet simply stops working, as per my Java Console somewhere after invoking the "start" method. Parts of the applet simply become gray and when I resize it - I have a JFrame in my applet - the whole JFrame becomes gray and does not respond to input nor it redraws itself. Shutting down IE does not close the JFrame(although the java console reports normal program termination and cleanup) and the only way to close it is through the task manager. I am using Windows 98SE btw.
    Does it sound similiar to your problem? It happens ONLY with IE, not with Mozilla. Anybody has an idea on what it could be? I doubt there's an error in my code...

  • Applet with swings

    Hi
    I developed a applet using swing componets.But it doesn't work.
    I used jdk1.3.1 for development.And I am using IE 5.0 and Netscape4.7 browsers.
    can any body help me what could be the problem?
    thanks

    Just explain the problem, might be i can help u.
    Any ways u should have the Plugin to run the Swing applet.
    Best of Luck!
    Ahmad Jamal.

  • Please help...Problem with 3D Applet using JRE 1.5

    Hi all,
    I have an applet which uses sun opengl 1.3.1 plugin to render some 3D graphics. It is working fine with JRE 1.4.2_06, but not showing the 3D graphics with the latest JRE 1.5 release. I tried to repaint using available API with no success.
    Please help asap,
    Thanks in advance
    prasad

    I wonder if you have the same problem as me... Maybe we can find a solution for us both, no need for me to open a new thread for this topic then...
    I wrote an applet using Swing and compiled it using JavaSDK 1.4.x. I also installed the 1.4.x JRE for both of my test browsers. In Mozilla 1.1 the applet displays properly all the time. In IE6 SP1 it sometimes works as intended but sometimes the applet simply stops working, as per my Java Console somewhere after invoking the "start" method. Parts of the applet simply become gray and when I resize it - I have a JFrame in my applet - the whole JFrame becomes gray and does not respond to input nor it redraws itself. Shutting down IE does not close the JFrame(although the java console reports normal program termination and cleanup) and the only way to close it is through the task manager. I am using Windows 98SE btw.
    Does it sound similiar to your problem? It happens ONLY with IE, not with Mozilla. Anybody has an idea on what it could be? I doubt there's an error in my code...

  • Applet using JXTA

    Hi, Can i use JXTA from a signed appleted to transfer a file to another applet. And is JXTA components provided in J2SE.
    Thanks!

    I wrote an applet using swing components that is running fine in applet viewer forgot to mention... you run appletviewer using .html file in your local computer, rite? so ARCHIVE = "oddsApplet.jar" means your jar in the current/same folder with the .html. your appletviewer can find it and start it.
    but when I try to use it in my browser it won't work.what url you are open? http://www.geocities.com/bla bla bla... or file://C:/bla bla bla... i think it will work with url=file://c:/ bla bla bla...
    I took the .jar file from the "NetBeansTM IDE 4.0 " and put that on my geocites web page in the same folder as the html file.ARCHIVE = "./oddsApplet.jar"

  • I can't use swing components in my applets

    When I write an applet without any swing components, my browser never has any trouble finding the classes it needs, whether they're classes I've written or classes that came with Java. However, when I try to use swing components it cannot find them, because it is looking in the wrong place:
    On my computer I have a directory called C:\Java, into which I installed my Java Development Kit (so Sun's classes are stored in the default location within that directory, wherever that is), and I store my classes in C:\Java\Files\[path depends on package]. My browser gives an error message along the lines of "Cannot find class JFrame at C:\Java\Files\javax\swing\JFrame.class"; it shouldn't be looking for this non-existent directory, it should find the swing components where it finds, for example, the Applet class and the Graphics class.
    Is there any way I can set the classpath on my browser? Are the swing components stored separately from other classes (I'm using the J2SE v1.3)?
    Thanks in advance.

    Without having complete information, it appears that you are running your applets using the browser's VM. Further, I assume you are using either IE or Netscape Navigator pre-v6. In that case, your browser only supports Java 1.1, and Swing was implemented in Java 1.2. You need to use the Java plug-in in order to use the Swing classes (see the Plug-in forum for more information), or else download the Swing classes from Sun and include them in your CLASSPATH.
    HTH,
    Carl Rapson

  • Please give me an exemple of an applet using a swing object.

    Please give me an exemple of an applet using a swing object.thank you.

    My problen is that the swing object do not appear in
    my applet. They appear only if i invoque the repaint
    methode.use JApplet, since awt components are heavyweight, and swing components are lightwieght, then your swing components get over painted with aplets background or something.
    anyhow, in your applet you may create JFrame, that would be swing component and if you set it visible, then it will be even visible.
    they say that mixing swing and awt is not good idea, especially when you don't know what you're doing (which might be true in your case)
    so try to migrate your app from AWT based stuff to SWING based stuff, or write your own AWT components that do the job whih you needed swing component for at the first place.
    but if you need to mix awt and swing, then i thing that you should not paint the fole area of applet in applets paint method -- but here i'm not sure, never mixed 'em.
    so you might try to create an applet which paint() method you leave empty and to which you add some JComponent*.
    and see what happens, maybe this JComponent will be visible.
    * -- JComponent is most likely just gray, you might want to add some subclass of it -- JButton, JTextField, JSomethingElse.

  • Using swing applet in IE

    Dear,
    Is there any way to use swing applet in IE.
    Thanks,

    If you are trying to make your code workable with Microsoft's VM, then I'd say you are looking for trouble. That VM's version is 1.1.4, if I'm not mistaken.
    Better stick to the JRE 1.4 with the plugin.

  • Devloping graphs using pure java without applets and swings

    Hi Guys
    i want to devlop bar graphs,pie charts,line graphs using pure java.i don't want to use applets and swings..does any body help on this asap..
    IT'S VERY URGENT
    cheers
    ANAND

    Go to
    http://java.sun.com/docs/books/tutorial/information/download.html#OLDui
    and get: Creating a User Interface (AWT Only) Archive (tut-OLDui.zip)

  • Desperately seeking help!! IE Crashes using Swing Applet

    Hi,
    I've created a grid applet using JTable and Swing in an applet. It runs great with data from a SQL database. I have at least 3 instances of the grid on the same page and other places on the site.
    However, Internet Explorer crashes frequently throwing an error "Unhandled exception at xxxxxxx in IExplore.exe (Beans.ocx).
    And the behavior is random and unpredictable.
    I've been desperately trying to look for help to fix this.
    Could someone please, please offer some suggestion?
    Thanks in advance,
    Anand.

    I agree. Try upgrading your plug-in version to 1.3.1. Keep in mind though that after 1.3.0, Sun changed where the plug-in looks for the root certificate. If you're using a Verisign or Thawte certificate, you shouldn't have any problems. If you're using your own certificate, you'll probably need to import it into the cacerts file in the lib/security directory under the installation directory of your jre.
    Hope this helps,
    Mark

  • Shall i use Swing or AWT for creating a chessboard applet??

    Hi,
    I need to build an applet which should dislpay a chessboard where i should
    be able to move the pieces around, read in a game analysis, etc...
    I am a beginner and i would like some advice on if i should use swing or awt?
    Which one is it easier to work with in terms of dispaying the pieces, moving the pieces and achieving other more challenging functionalities?
    Is it good idea to mix both of them? i.e have a japplet and use a canvas for displaying the board??
    Any advice would be much obliged.

    I used to think AWT
    And someone told me Swing was better..and that all of the Drag-n-Drop stuff doesn't work well with AWT.
    I have to admit that I used AWT up until a project about 3 months ago--I liked it better, but Swing does seem to have more builtins for handling the things you would need to for the Chess Board. Not that you CAN'T do them with AWT, but that they are harder to do with AWT.
    As far as reading in game analysis, etc..that really is independent of Swing/AWT

Maybe you are looking for

  • Adding check box in the transaction xd02

    hi friends,   My requirement is to add a check box in the customer change : contact person details standard screen in the transaction xd02. can any one please give me the suggestions for that?

  • Locked iPod, can't get to password screen

    I just got a used iPod touch and have the passcode. When I turn on the iPod, though, I have no way to put in the passcode, the screen just says "iPod is disabled, connect to iTunes". I have tried but I don't think iTunes is recognizing the device; pl

  • No dynamic LOV in a PopUP column?

    Hi, </br></br> I've a named LOV-query for a column of the detail report on a master-detail-form. </br></br> the column is displayed as Popup LOV (named LOV) with that query: </br></br></br> IF :P306_KAT = 'KUNDE' THEN RETURN IF :P306_KAT = 'KUNDE' TH

  • Text fields cannot be deleted in field group in Query

    Hi Experts, I created an additional table ZTEST for node A in InfoSet and chose some fields which have text fields into Field Group for display. Then in SQ01, those selected fields appeared in my Query field selection. Of course I can tick it to disp

  • How to use Portal Navigation to redirect to the URL

    Hi , I have a requirement where i need to log off the user which will invalidate the session and redirect the user to the Portal Login Page. <b>The logoff.jsp is in a path like /web/logoff.jsp in the server.</b> As there is a Problem with exit plug,