Need a Big Help please on how to use getAppletContext() method

I have three classes, first one extends JApplet, second class I use two create my popup menus, third class I use for my main actions to be done. I need when a popup menu is clicked to load a page, but I am getting this error.
java.lang.NullPointerException
at java.applet.Applet.getAppletContext(Applet.java:171)
at Popup_Menus$1.actionPerformed(Popup_Menus.java:90)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
at javax.swing.AbstractButton.doClick(AbstractButton.java:289)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1113)
at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:943)
at java.awt.Component.processMouseEvent(Component.java:5134)
at java.awt.Component.processEvent(Component.java:4931)
at java.awt.Container.processEvent(Container.java:1566)
at java.awt.Component.dispatchEventImpl(Component.java:3639)
at java.awt.Container.dispatchEventImpl(Container.java:1623)
at java.awt.Component.dispatchEvent(Component.java:3480)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
at java.awt.Container.dispatchEventImpl(Container.java:1609)
at java.awt.Component.dispatchEvent(Component.java:3480)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Ev
My Code is messy, but here it is: -
Class One
//package final_project;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;
import java.util.*;
import java.io.*;
import java.applet.*;
import java.net.*;
public class Main_Interface extends JApplet implements Runnable {
GUICanvas MainCanvas;
int counter = 0;
protected int delay = 10000;
private Thread timeThread= null;
     public void init() {
     Container contentPane = getContentPane();
MainCanvas = new GUICanvas();
contentPane.setBounds(0,0,850,650);
     contentPane.add(MainCanvas);
public void start() {
timeThread = new Thread(this);
timeThread.start();
public void run() {
Thread myThread = Thread.currentThread();
while (timeThread == myThread) {
try {
Thread.currentThread().sleep(delay);
} catch (InterruptedException e){}
counter ++;
MainCanvas.TheKing();
Class Two
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;
import java.util.*;
import java.io.*;
import java.applet.*;
import java.net.*;
import java.applet.*;
public class Popup_Menus extends Applet implements MouseListener {
JPopupMenu ar[] = new JPopupMenu[16];
JMenuItem it[] = new JMenuItem[84];
public Popup_Menus() {
for (int i=0;i<16;i++)
ar[i] = new JPopupMenu();
for (int i=0;i<84;i++)
it[i] = new JMenuItem();
it.setBackground(Color.orange);
it[i].setForeground(Color.cyan);
it[16]= new JMenuItem("Shop Details");
it[17]= new JMenuItem("NoOfStaff");
it[18]= new JMenuItem("ShopAssest");
it[0] = new JMenuItem("Oracle");
ar[0].add(it[0]);
it[1] = new JMenuItem("Macrosoft");
ar[1].add(it[1]);
it[2] = new JMenuItem("SunMicro");
ar[2].add(it[2]);
it[3] = new JMenuItem("PeopleSoft");
ar[3].add(it[3]);
it[4] = new JMenuItem("HP");
ar[4].add(it[4]);
it[5] = new JMenuItem("Dell");
ar[5].add(it[5]);
it[6] = new JMenuItem("Compact");
ar[6].add(it[6]);
it[7] = new JMenuItem("Apple");
ar[7].add(it[7]);
it[8] = new JMenuItem("Sony");
ar[8].add(it[8]);
it[9] = new JMenuItem("Philipes");
ar[9].add(it[9]);
it[10] = new JMenuItem("Bush");
ar[10].add(it[0]);
it[11] = new JMenuItem("Granada");
ar[11].add(it[11]);
it[12] = new JMenuItem("PC");
ar[12].add(it[12]);
it[13] = new JMenuItem("Macintosh");
ar[13].add(it[13]);
it[14] = new JMenuItem("Laptop");
ar[14].add(it[14]);
it[15] = new JMenuItem("Solaris");
ar[15].add(it[15]);
it[0].addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
ar[0].add(it[16]);
ar[0].add(it[17]);
ar[0].add(it[18]);
System.out.println("Working");
// ma = new Main_Interface();
try
System.out.println("menuitem");
String s="ali";
URL url = new URL("http://www.google.com");
getAppletContext().showDocument(url,s);
catch(MalformedURLException malformedurlexception)
System.err.println(malformedurlexception);
public void mouseClicked(java.awt.event.MouseEvent e) {
//ar[0].show(this,30,30);
public void mouseEntered(java.awt.event.MouseEvent mouseEvent) {
public void mouseExited(java.awt.event.MouseEvent mouseEvent) {
public void mousePressed(java.awt.event.MouseEvent mouseEvent) {
public void mouseReleased(java.awt.event.MouseEvent mouseEvent) {
Class Three
//package final_project;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;
import java.util.*;
import java.io.*;
import java.applet.*;
import java.net.*;
public class GUICanvas extends JPanel implements MouseMotionListener,ActionListener,MouseListener
private Color color;
Popup_Menus popup = new Popup_Menus();
private Font font;
double a1, Q = 0,Z = 0,P = 1, S1;
String Percentages;
double Aa=0,Ba=0,Ca=0,Da=0;
double Aa1=0,Ba1=0,Ca1=0,Da1=0;
double Aa2=0,Ba2=0,Ca2=0,Da2=0;
double Aa3=0,Ba3=0,Ca3=0,Da3=0;
double Aa4=0,Ba4=0,Ca4=0,Da4=0;
double Sum = 0,Sum1 = 0, Sum2 = 0, Sum3 = 0, Sum4 = 0;
double A=0, B=0, C=0, D=0;
double A1=0, B1=0, C1=0, D1=0,A2=0, B2=0, C2=0, D2=0;
double k1=0,k2=0,l1=0,l2=0,r1=0,r2=0,u1=0,u2=0;
int xpos,ypos,popcounter=0;
double DC1[] = new double[4];
double DC2[] = new double[4];
double DC3[] = new double[4];
double DC4[] = new double[4];
boolean rect1Active[] = new boolean[4];
boolean rect1Active2[] = new boolean[4];
boolean rect1Active3[] = new boolean[4];
boolean rect1Active4[] = new boolean[4];
double DF1[] = new double[4];
double DF2[] = new double[4];
double DF3[] = new double[4];
double DF4[] = new double[4];
double Ap[] = new double[4];
double Bp[] = new double[4];
double Cp[] = new double[4];
double Dp[] = new double[4];
int rect1width[] = new int[4];
int rect1height[] = new int[4];
int rect1xco[] = new int[4];
int rect1yco[] = new int[4];
int rect1width2[] = new int[4];
int rect1height2[] = new int[4];
int rect1xco2[] = new int[4];
int rect1yco2[] = new int[4];
int rect1width3[] = new int[4];
int rect1height3[] = new int[4];
int rect1xco3[] = new int[4];
int rect1yco3[] = new int[4];
int rect1width4[] = new int[4];
int rect1height4[] = new int[4];
int rect1xco4[] = new int[4];
int rect1yco4[] = new int[4];
double rect1width5[] = new double[4];
double rect1height5[] = new double[4];
double rect1xco5[] = new double[4];
double rect1yco5[] = new double[4];
public GUICanvas() {
setBackground( Color.black );
TheKing();
addMouseListener(this);
addMouseMotionListener(this);
public void TheKing()
double X=740, Y=470, Ap=0,Bp=0,Cp=0,Dp=0;
String line[] = new String[4];
/* try {
URL url = new URL(
     "http://localhost:111/test/servlet/TestServlet");
BufferedReader in = new BufferedReader(
     new InputStreamReader(url.openStream()));
for (int i = 0; i<4; i++)
line[i] = in.readLine();
in.close();
}catch (Exception e){
e.printStackTrace();
line[0] = "200";
line[1] = "200";
line[2] = "200";
line[3] = "200";
Aa = s2d(line[0]);
Ba = s2d(line[1]);
Ca = s2d(line[2]);
Da = s2d(line[3]);
rect1xco5[0] = 20;
rect1yco5[0] = 20;
Sum=Aa+Ba+Ca+Da;
Ap = (Aa/Sum)*100;
Bp = (Ba/Sum)*100;
Cp = (Ca/Sum)*100;
Dp = (Da/Sum)*100;
A= (Ap/100)*(X*Y);
B= (Bp/100)*(X*Y);
C= (Cp/100)*(X*Y);
D= (Dp/100)*(X*Y);
Q = ((A*C)+(X*Y*D)+(X*C*Y)+(B*X*Y)-(Y*A*X)-((X*X)*(Y*Y))-(B*D))/((X*(Y*Y))-(Y*D)-(C*Y));
Z = (((X*X)*Y*A)-(X*C*A)-(B*X*A))/((X*(Y*Y))-(Y*D)-(C*Y));
A1 =((-Q) + (Math.sqrt((Q*Q)-(4*P*Z))))/(2*P);
A2=A/A1;
B1=X-A1;
B2=B/B1;
D2=Y-A2;
D1=D/D2;
C1=X-D1;
C2=C/C1;
S1=B2+C2;
rect1width5[0] = d2i(A1);
rect1height5[0] = d2i(A2);
rect1width5[1] = d2i(B1);
rect1height5[1] = d2i(B2);
rect1width5[2] = d2i(D1);
rect1height5[2] = d2i(D2);
rect1width5[3] = d2i(C1);
rect1height5[3] = d2i(C2);
rect1xco5[1] = rect1xco5[0] + rect1width5[0];
rect1yco5[1] = rect1xco5[0];
rect1xco5[2] = rect1xco5[0];
rect1yco5[2] = rect1yco5[0] + rect1height5[0];
rect1xco5[3] = rect1xco5[0] + rect1width5[2];
rect1yco5[3] = rect1yco5[0] + rect1height5[1];
k1=rect1xco5[0]+rect1width5[0];
k2=rect1yco5[0]+rect1height5[0];
l1=rect1width5[1]-20;
l2=rect1yco5[1]+rect1height5[1];
r1=rect1xco5[0]+rect1width5[2];
r2=rect1height5[2]-20;
u1=rect1width5[3]-20;
u2=rect1height5[3]-20;
RegionOne(k1, k2);
RegionTwo(l1,l2);
RegionThree(r1, r2);
RegionFour(u1, u2);
public void RegionOne(double X1, double Y1)
String line[] = new String[4];
/* try {
URL url = new URL(
     "http://localhost:111/test/servlet/TestServlet1?name=ONE");
BufferedReader in = new BufferedReader(
     new InputStreamReader(url.openStream()));
for (int i = 0; i<4; i++)
line[i] = in.readLine();
in.close();
}catch (Exception e){
e.printStackTrace();
line[0] = "1200";
line[1] = "2100";
line[2] = "1200";
line[3] = "2100";
DC1[0] = Aa1 ;
DC1[1] = Ba1 ;
DC1[2] = Ca1;
DC1[3] = Da1;
Aa1 = s2d(line[0]);
Ba1 = s2d(line[1]);
Ca1 = s2d(line[2]);
Da1 = s2d(line[3]);
DF1[0] = Aa1 ;
DF1[1] = Ba1 ;
DF1[2] = Ca1;
DF1[3] = Da1;
rect1xco[0] = 20;
rect1yco[0] = 20;
Sum1=Aa1+Ba1+Ca1+Da1;
Ap[0] = (Aa1/Sum1)*100;
Bp[0] = (Ba1/Sum1)*100;
Cp[0] = (Ca1/Sum1)*100;
Dp[0] = (Da1/Sum1)*100;
A= (Ap[0]/100)*(X1*Y1);
B= (Bp[0]/100)*(X1*Y1);
C= (Cp[0]/100)*(X1*Y1);
D= (Dp[0]/100)*(X1*Y1);
Q = ((A*C)+(X1*Y1*D)+(X1*C*Y1)+(B*X1*Y1)-(Y1*A*X1)-((X1*X1)*(Y1*Y1))-(B*D))/((X1*(Y1*Y1))-(Y1*D)-(C*Y1));
Z = (((X1*X1)*Y1*A)-(X1*C*A)-(B*X1*A))/((X1*(Y1*Y1))-(Y1*D)-(C*Y1));
A1 =((-Q) + (Math.sqrt((Q*Q)-(4*P*Z))))/(2*P);
A2=A/A1;
B1=X1-A1;
B2=B/B1;
D2=Y1-A2;
D1=D/D2;
C1=X1-D1;
C2=C/C1;
S1=B2+C2;
rect1width[0] = d2i(A1);
rect1height[0] = d2i(A2);
rect1width[1] = d2i(B1);
rect1height[1] = d2i(B2);
rect1width[2] = d2i(D1);
rect1height[2] = d2i(D2);
rect1width[3] = d2i(C1);
rect1height[3] = d2i(C2);
rect1xco[1] = rect1xco[0] + rect1width[0];
rect1yco[1] = rect1xco[0];
rect1xco[2] = rect1xco[0];
rect1yco[2] = rect1yco[0] + rect1height[0];
rect1xco[3] = rect1xco[0] + rect1width[2];
rect1yco[3] = rect1yco[0] + rect1height[1];
public void RegionTwo(double X2, double Y2)
String line[] = new String[4];
/* try {
URL url = new URL(
     "http://localhost:111/test/servlet/TestServlet1?name=TWO");
BufferedReader in = new BufferedReader(
     new InputStreamReader(url.openStream()));
for (int i = 0; i<4; i++)
line[i] = in.readLine();
in.close();
catch (Exception e){
e.printStackTrace();
line[0] = "1200";
line[1] = "2100";
line[2] = "1200";
line[3] = "2100";
DC2[0] = Aa2;
DC2[1] = Ba2;
DC2[2] = Ca2;
DC2[3] = Da2;
Aa2 = s2d(line[0]);
Ba2 = s2d(line[1]);
Ca2 = s2d(line[2]);
Da2 = s2d(line[3]);
DF2[0] = Aa2 ;
DF2[1] = Ba2 ;
DF2[2] = Ca2;
DF2[3] = Da2;
rect1xco2[0] = rect1xco[1]+rect1width[1];
rect1yco2[0] = 20;
Sum2=Aa2+Ba2+Ca2+Da2;
Ap[1] = (Aa2/Sum2)*100;
Bp[1] = (Ba2/Sum2)*100;
Cp[1] = (Ca2/Sum2)*100;
Dp[1] = (Da2/Sum2)*100;
A= (Ap[1]/100)*(X2*Y2);
B= (Bp[1]/100)*(X2*Y2);
C= (Cp[1]/100)*(X2*Y2);
D= (Dp[1]/100)*(X2*Y2);
Q = ((A*C)+(X2*Y2*D)+(X2*C*Y2)+(B*X2*Y2)-(Y2*A*X2)-((X2*X2)*(Y2*Y2))-(B*D))/((X2*(Y2*Y2))-(Y2*D)-(C*Y2));
Z = (((X2*X2)*Y2*A)-(X2*C*A)-(B*X2*A))/((X2*(Y2*Y2))-(Y2*D)-(C*Y2));
A1 =((-Q) + (Math.sqrt((Q*Q)-(4*P*Z))))/(2*P);
A2=A/A1;
B1=X2-A1;
B2=B/B1;
D2=Y2-A2;
D1=D/D2;
C1=X2-D1;
C2=C/C1;
rect1width2[0] = d2i(A1);
rect1height2[0] = d2i(A2);
rect1width2[1] = d2i(B1);
rect1height2[1] = d2i(B2);
rect1width2[2] = d2i(D1);
rect1height2[2] = d2i(D2);
rect1width2[3] = d2i(C1);
rect1height2[3] = d2i(C2);
rect1xco2[1] = rect1xco2[0] + rect1width2[0];
rect1yco2[1] = rect1yco2[0];
rect1xco2[2] = rect1xco2[0];
rect1yco2[2] = rect1yco2[0] + rect1height2[0];
rect1xco2[3] = rect1xco2[0] + rect1width2[2];
rect1yco2[3] = rect1yco2[0] + rect1height2[1];
public void RegionThree(double X3, double Y3)
String line[] = new String[4];
/* try {
URL url = new URL(
     "http://localhost:111/test/servlet/TestServlet1?name=THREE");
BufferedReader in = new BufferedReader(
     new InputStreamReader(url.openStream()));
for (int i = 0; i<4; i++)
line[i] = in.readLine();
in.close();
catch (Exception e){
e.printStackTrace();
line[0] = "1200";
line[1] = "2100";
line[2] = "1200";
line[3] = "2100";
DC3[0] = Aa3 ;
DC3[1] = Ba3 ;
DC3[2] = Ca3;
DC3[3] = Da3;
Aa3 = s2d(line[0]);
Ba3 = s2d(line[1]);
Ca3 = s2d(line[2]);
Da3 = s2d(line[3]);
DF3[0] = Aa3 ;
DF3[1] = Ba3;
DF3[2] = Ca3;
DF3[3] = Da3;
rect1xco3[0] = 20;
rect1yco3[0] = rect1yco[2]+rect1height[2];
Sum3=Aa3+Ba3+Ca3+Da3;
Ap[2] = (Aa3/Sum3)*100;
Bp[2] = (Ba3/Sum3)*100;
Cp[2] = (Ca3/Sum3)*100;
Dp[2] = (Da3/Sum3)*100;
A= (Ap[2]/100)*(X3*Y3);
B= (Bp[2]/100)*(X3*Y3);
C= (Cp[2]/100)*(X3*Y3);
D= (Dp[2]/100)*(X3*Y3);
Q = ((A*C)+(X3*Y3*D)+(X3*C*Y3)+(B*X3*Y3)-(Y3*A*X3)-((X3*X3)*(Y3*Y3))-(B*D))/((X3*(Y3*Y3))-(Y3*D)-(C*Y3));
Z = (((X3*X3)*Y3*A)-(X3*C*A)-(B*X3*A))/((X3*(Y3*Y3))-(Y3*D)-(C*Y3));
A1 =((-Q) + (Math.sqrt((Q*Q)-(4*P*Z))))/(2*P);
A2=A/A1;
B1=X3-A1;
B2=B/B1;
D2=Y3-A2;
D1=D/D2;
C1=X3-D1;
C2=C/C1;
rect1width3[0] = d2i(A1);
rect1height3[0] = d2i(A2);
rect1width3[1] = d2i(B1);
rect1height3[1] = d2i(B2);
rect1width3[2] = d2i(D1);
rect1height3[2] = d2i(D2);
rect1width3[3] = d2i(C1);
rect1height3[3] = d2i(C2);
rect1xco3[1] = rect1xco3[0] + rect1width3[0];
rect1yco3[1] = rect1yco[3] + rect1height[3];
rect1xco3[2] = rect1xco3[0];
rect1yco3[2] = rect1yco3[0] + rect1height3[0];
rect1xco3[3] = rect1xco3[0] + rect1width3[2];
rect1yco3[3] = rect1yco3[0] + rect1height3[1];
public void RegionFour(double X4, double Y4)
String line[] = new String[4];
/*try {
URL url = new URL(
     "http://localhost:111/test/servlet/TestServlet1?name=FOUR");
BufferedReader in = new BufferedReader(
     new InputStreamReader(url.openStream()));
for (int i = 0; i<4; i++)
line[i] = in.readLine();
in.close();
catch (Exception e){
e.printStackTrace();
line[0] = "1200";
line[1] = "2100";
line[2] = "1200";
line[3] = "2100";
DC4[0] = Aa4 ;
DC4[1] = Ba4 ;
DC4[2] = Ca4;
DC4[3] = Da4;
Aa4 = s2d(line[0]);
Ba4 = s2d(line[1]);
Ca4 = s2d(line[2]);
Da4 = s2d(line[3]);
DF4[0] = Aa4 ;
DF4[1] = Ba4 ;
DF4[2] = Ca4;
DF4[3] = Da4;
rect1xco4[0] = rect1xco3[1]+rect1width3[1];
rect1yco4[0] = rect1yco2[2]+rect1height2[2];
Sum4=Aa4+Ba4+Ca4+Da4;
Ap[3] = (Aa4/Sum4)*100;
Bp[3] = (Ba4/Sum4)*100;
Cp[3] = (Ca4/Sum4)*100;
Dp[3] = (Da4/Sum4)*100;
A= (Ap[3]/100)*(X4*Y4);
B= (Bp[3]/100)*(X4*Y4);
C= (Cp[3]/100)*(X4*Y4);
D= (Dp[3]/100)*(X4*Y4);
Q = ((A*C)+(X4*Y4*D)+(X4*C*Y4)+(B*X4*Y4)-(Y4*A*X4)-((X4*X4)*(Y4*Y4))-(B*D))/((X4*(Y4*Y4))-(Y4*D)-(C*Y4));
Z = (((X4*X4)*Y4*A)-(X4*C*A)-(B*X4*A))/((X4*(Y4*Y4))-(Y4*D)-(C*Y4));
A1 =((-Q) + (Math.sqrt((Q*Q)-(4*P*Z))))/(2*P);
A2=A/A1;
B1=X4-A1;
B2=B/B1;
D2=Y4-A2;
D1=D/D2;
C1=X4-D1;
C2=C/C1;
rect1width4[0] = d2i(A1);
rect1height4[0] = d2i(A2);
rect1width4[1] = d2i(B1);
rect1height4[1] = d2i(B2);
rect1width4[2] = d2i(D1);
rect1height4[2] = d2i(D2);
rect1width4[3] = d2i(C1);
rect1height4[3] = d2i(C2);
rect1xco4[1] = rect1xco4[0] + rect1width4[0];
rect1yco4[1] = rect1yco2[2]+rect1height2[2];
rect1xco4[2] = rect1xco4[0];
rect1yco4[2] = rect1yco4[0] + rect1height4[0];
rect1xco4[3] = rect1xco4[0] + rect1width4[2];
rect1yco4[3] = rect1yco4[0] + rect1height4[1];
static int d2i(double d) {return (int) Math.round(d);}
static double i2d(int i) {return (double) i;}
static double s2d(String s)
double i=0;
try{  return i = Double.parseDouble(s);}
catch(NumberFormatException e)
{  e.printStackTrace();}
return i;
public void paintComponent(Graphics g) {
super.paintComponent(g);
int k11=d2i(k1);
int k21=d2i(k2);
int l11=d2i(l1);
int l21=d2i(l2);
int r11=d2i(r1);
int r21=d2i(r2);
int u11=d2i(u1);
int u21=d2i(u2);
g.setColor(Color.magenta);
g.drawRect(rect1xco[0]-2,rect1yco[0]-2,k11+2,k21+2);
g.drawRect(rect1xco[0]-1,rect1yco[0]-1,k11+2,k21+1);
g.drawRect(rect1xco2[0]+1,rect1yco2[0]-1,l11+1,l21+1);
g.drawRect(rect1xco2[0]+1,rect1yco2[0]-2,l11+2,l21+2);
g.drawRect(rect1xco3[0]-1,rect1yco3[0]+1,r11+2,r21+1);
g.drawRect(rect1xco3[0]-2,rect1yco3[0]+1,r11+2,r21+2);
g.drawRect(rect1xco4[0]+1,rect1yco4[0]+1,u11+2,u21+1);
g.drawRect(rect1xco4[0]+1,rect1yco4[0]+1,u11+1,u21+2);
g.setColor(Color.cyan);
g.drawRect(16,16,749,479);
g.drawRect(17,17,747,477);
if (rect1Active[0])
// First Rectangle's coloring of the Region One
if(DC1[0] == DF1[0])
g.setColor(Color.black);
g.fillRect(rect1xco[0]+2,rect1yco[0]+2,rect1width[0]-4,rect1height[0]-4);
g.setColor(Color.yellow);
g.drawRect(rect1xco[0],rect1yco[0],rect1width[0]-1,rect1height[0]-1);
g.drawRect(rect1xco[0]+1,rect1yco[0]+1,rect1width[0]-3,rect1height[0]-3);
else if(DC1[0] > DF1[0])
g.setColor(Color.red);
g.fillRect(rect1xco[0]+2,rect1yco[0]+2,rect1width[0]-4,rect1height[0]-4);
g.setColor(Color.yellow);
g.drawRect(rect1xco[0],rect1yco[0],rect1width[0]-1,rect1height[0]-1);
g.drawRect(rect1xco[0]+1,rect1yco[0]+1,rect1width[0]-3,rect1height[0]-3);
else if(DC1[0] < DF1[0])
g.setColor(Color.green);
g.fillRect(rect1xco[0]+2,rect1yco[0]+2,rect1width[0]-4,rect1height[0]-4);
g.setColor(Color.yellow);
g.drawRect(rect1xco[0],rect1yco[0],rect1width[0]-1,rect1height[0]-1);
g.drawRect(rect1xco[0]+1,rect1yco[0]+1,rect1width[0]-3,rect1height[0]-3);
else
if(DC1[0] == DF1[0])
g.setColor(Color.black);
g.fillRect(rect1xco[0],rect1yco[0],rect1width[0],rect1height[0]);
else if(DC1[0] > DF1[0])
g.setColor(Color.red);
g.fillRect(rect1xco[0],rect1yco[0],rect1width[0],rect1height[0]);
else if(DC1[0] < DF1[0])
g.setColor(Color.green);
g.fillRect(rect1xco[0],rect1yco[0],rect1width[0],rect1height[0]);
if (rect1Active[1])
// Second Rectangle's coloring of the Region One
if(DC1[1] == DF1[1])
g.setColor(Color.black);
g.fillRect(rect1xco[1]+2,rect1yco[1]+2,rect1width[1]-4,rect1height[1]-4);
g.setColor(Color.yellow);
g.drawRect(rect1xco[1],rect1yco[1],rect1width[1]-1,rect1height[1]-1);
g.drawRect(rect1xco[1]+1,rect1yco[1]+1,rect1width[1]-3,rect1height[1]-3);
else if(DC1[1] > DF1[1])
g.setColor(Color.red);
g.fillRect(rect1xco[1]+2,rect1yco[1]+2,rect1width[1]-4,rect1height[1]-4);
g.setColor(Color.yellow);
g.drawRect(rect1xco[1],rect1yco[1],rect1width[1]-1,rect1height[1]-1);
g.drawRect(rect1xco[1]+1,rect1yco[1]+1,rect1width[1]-3,rect1height[1]-3);
else if(DC1[1] < DF1[1])
g.setColor(Color.green);
g.fillRect(rect1xco[1]+2,rect1yco[1]+2,rect1width[1]-4,rect1height[1]-4);
g.setColor(Color.yellow);
g.drawRect(rect1xco[1],rect1yco[1],rect1width[1]-1,rect1height[1]-1);
g.drawRect(rect1xco[1]+1,rect1yco[1]+1,rect1width[1]-3,rect1height[1]-3);
else
if(DC1[1] == DF1[1])
g.setColor(Color.black);
g.fillRect(rect1xco[1],rect1yco[1],rect1width[1],rect1height[1]);
else if(DC1[1] > DF1[1])
g.setColor(Color.red);
g.fillRect(rect1xco[1],rect1yco[1],rect1width[1],rect1height[1]);
else if(DC1[1] < DF1[1])
g.setColor(Color.green);
g.fillRect(rect1xco[1],rect1yco[1],rect1width[1],rect1height[1]);
if (rect1Active [2])
// Third Rectangle's coloring of the Region One
if(DC1[2] == DF1[2])
g.setColor(Color.black);
g.fillRect(rect1xco[2]+2,rect1yco[2]+2,rect1width[2]-4,rect1height[2]-4);
g.setColor(Color.yellow);
g.drawRect(rect1xco[2],rect1yco[2],rect1width[2]-1,rect1height[2]-1);
g.drawRect(rect1xco[2]+1,rect1yco[2]+1,rect1width[2]-3,rect1height[2]-3);
else if(DC1[2] > DF1[2])
g.setColor(Color.red);
g.fillRect(rect1xco[2]+2,rect1yco[2]+2,rect1width[2]-4,rect1height[2]-4);
g.setColor(Color.yellow);
g.drawRect(rect1xco[2],rect1yco[2],rect1width[2]-1,rect1height[2]-1);
g.drawRect(rect1xco[2]+1,rect1yco[2]+1,rect1width[2]-3,rect1height[2]-3);
else if(DC1[2] < DF1[2])
g.setColor(Color.green);
g.fillRect(rect1xco[2]+2,rect1yco[2]+2,rect1width[2]-4,rect1height[2]-4);
g.setColor(Color.yellow);
g.drawRect(rect1xco[2],rect1yco[2],rect1width[2]-1,rect1height[2]-1);
g.drawRect(rect1xco[2]+1,rect1yco[2]+1,rect1width[2]-3,rect1height[2]-3);
else
if(DC1[2] == DF1[2])
g.setColor(Color.black);
g.fillRect(rect1xco[2],rect1yco[2],rect1width[2],rect1height[2]);
else if(DC1[2] > DF1[2])
g.setColor(Color.red);
g.fillRect(rect1xco[2],rect1yco[2],rect1width[2],rect1height[2]);
else if(DC1[2] < DF1[2])
g.setColor(Color.green);
g.fillRect(rect1xco[2],rect1yco[2],rect1width[2],rect1height[2]);
if (rect1Active [3])
//Fourth Rectangle's coloring of the Region One
if(DC1[3] == DF1[3])
g.setColor(Color.black);
g.fillRect(rect1xco[3]+2,rect1yco[3]+2,rect1width[3]-4,rect1height[3]-4);
g.setColor(Color.yellow);
g.drawRect(rect1xco[3],rect1yco[3],rect1width[3]-1,rect1height[3]-1);
g.drawRect(rect1xco[3]+1,rect1yco[3]+1,rect1width[3]-3,rect1height[3]-3);
else if(DC1[3] > DF1[3])
g.setColor(Color.red);
g.fillRect(rect1xco[3]+2,rect1yco[3]+2,rect1width[3]-4,rect1height[3]-4);
g.setColor(Color.yellow);
g.drawRect(rect1xco[3],rect1yco[3],rect1width[3]-1,rect1height[3]-1);
g.drawRect(rect1xco[3]+1,rect1yco[3]+1,rect1width[3]-3,rect1height[3]-3);
else if(DC1[3] < DF1[3])
g.setColor(Color.green);
g.fillRect(rect1xco[3]+2,rect1yco[3]+2,rect1width[3]-4,rect1height[3]-4);
g.setColor(Color.yellow);
g.drawRect(rect1xco[3],rect1yco[3],rect1width[3]-1,rect1height[3]-1);
g.drawRect(rect1xco[3]+1,rect1yco[3]+1,rect1width[3]-3,rect1height[3]-3);
else
if(DC1[3] == DF1[3])
g.setColor(Color.black);
g.fillRect(rect1xco[3],rect1yco[3],rect1width[3],rect1height[3]);
else if(DC1[3] > DF1[3])
g.setColor(Color.red);
g.fillRect(rect1xco[3],rect1yco[3],rect1width[3],rect1height[3]);
else if(DC1[3] < DF1[3])
g.setColor(Color.green);
g.fillRect(rect1xco[3],rect1yco[3],rect1width[3],rect1height[3]);
if (rect1Active2[0])
// First Rectangle's coloring of the Region Two
if(DC2[0] == DF2[0])
g.setColor(Color.black);
g.fillRect(rect1xco2[0]+4,rect1yco2[0]+2,rect1width2[0]-4,rect1height2[0]-4);
g.setColor(Color.yellow);
g.drawRect(rect1xco2[0]+2,rect1yco2[0],rect1width2[0]-1,rect1height2[0]-1);
g.drawRect(rect1xco2[0]+3,rect1yco2[0]+1,rect1width2[0]-3,rect1height2[0]-3);
else if(DC2[0] > DF2[0])
g.setColor(Color.red);
g.fillRect(rect1xco2[0]+4,rect1yco2[0]+2,rect1width2[0]-4,rect1height2[0]-4);
g.setColor(Color.yellow);
g.drawRect(rect1xco2[0]+2,rect1yco2[0],rect1width2[0]-1,rect1height2[0]-1);
g.drawRect(rect1xco2[0]+3,rect1yco2[0]+1,rect1width2[0]-3,rect1height2[0]-3);
else if(DC2[0] < DF2[0])
g.setColor(Color.green);
g.fillRect(rect1xco2[0]+4,rect1yco2[0]+2,rect1width2[0]-4,rect1height2[0]-4);
g.setColor(Color.yellow);
g.drawRect(rect1xco2[0]+2,rect1yco2[0],rect1width2[0]-1,rect1height2[0]-1);
g.drawRect(rect1xco2[0]+3,rect1yco2[0]+1,rect1width2[0]-3,rect1height2[0]-3);
else
if(DC2[0] == DF2[0])
g.setColor(Color.black);
g.fillRect(rect1xco2[0]+2,rect1yco2[0],rect1width2[0],rect1height2[0]);
else if(DC2[0] > DF2[0])
g.setColor(Color.red);
g.fillRect(rect1xco2[0]+2,rect1yco2[0],rect1width2[0],rect1height2[0]);
else if(DC2[0] < DF2[0])
g.setColor(Color.green);
g.fillRect(rect1xco2[0]+2,rect1yco2[0],rect1width2[0],rect1height2[0]);
if (rect1Active2[1])
// Second Rectangle's coloring of the Region Two
if(DC2[1] == DF2[1])
g.setColor(Color.black);
g.fillRect(rect1xco2[1]+4,rect1yco2[1]+2,rect1width2[1]-4,rect1height2[1]-4);
g.setColor(Color.yellow);
g.drawRect(rect1xco2[1]+2,rect1yco2[1],rect1width2[1]-1,rect1height2[1]-1);
g.drawRect(rect1xco2[1]+3,rect1yco2[1]+1,rect1width2[1]-3,rect1height2[1]-3);

Could you show me how to use it as an applet. If you
can modify my code and make it working it would be
very helpful.
Best regards
AliPerhaps you could start [url http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html]here[url                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Need a big help please

    hi all,
    i receaved Oracle 11g and would like to install it but when it is started, it is asked to me to put the SID , what can it be? and would like to have a full detail to fill in once installing.
    thanks,

    977714 wrote:
    hi all,
    i receaved Oracle 11g and would like to install it but when it is started, it is asked to me to put the SID , what can it be? and would like to have a full detail to fill in once installing.
    thanks,Did you read the Installation Guide?

  • Help Please!: How to use multiple Transmit keys in WEP??

    I am a new Mac user with a MacBook Pro..
    I am able to use the wireless connection when at home, however I am having issues when at work...I think this is due to the fact that my work puts out 2 wep keys and then tells us which of the two keys are the transmit key....I believe the other key must be used for encryption/decryption purposes...It may work once the transmit key is #1, but its not always #1 (currently it is not)...
    Using the wireless setup interface in the os, I only have the ability to add one WEP key..this means it is only transmitting key #1.....
    Is there some sort of advanced setting which would allow me to add multiple keys and then select the key which should be used as the transmit key? This is common on Windows systems...I would assume Mac could do it also...
    Without the ability to add more than one key and select the transmit one, I will be unable to get into my corporate wrieless setup...
    Thanks for your help!!
    MacBook Pro   Mac OS X (10.4.5)  

    Basically..is there a way to set a WEP key and have it negotiate as transmit key #2 ??????

  • HT1199 I need your help, PLEASE. How can to fix "NO MOUNTABLE FILE SYSTEM" error of my back up hard drive on Mountain Lion OS?

    I need your help, PLEASE. How can to fix "NO MOUNTABLE FILE SYSTEM" error of my back up hard drive on Mountain Lion OS?

    Did you format the drive for Mac use before you tried to use it as a backup drive?
    Are you using Time Machine on the drive? You can't view the contents of its backup database and the only way to access the info is directly from the Time Machine app.

  • Brand new Mac user help please! How do you connect a 17" monitor to the MacBook? I have the monitor plugged into the Mac, but the F8 that I am used to with PC does not work. Please help. Thanks.

    Brand new Mac user help please! How do you connect a 17" monitor to the MacBook? I have the monitor plugged into the Mac, but the F8 that I am used to with PC does not work. Please help. I am getting lots of spelling errors as the MacBook laptop screen is too small. Thank you so much! .

    Contentmom6 wrote:
    Brand new Mac user help please! How do you connect a 17" monitor to the MacBook? I have the monitor plugged into the Mac, but the F8 that I am used to with PC does not work.
    Normally, you just connect the monitor to the MacBook using a VGA adaptor that you can buy from an Apple Store.  Now try System Preferences > Displays > Detect Displays.  You should now be able to select a display mode for the monitor.  If it still doesn't work, then I'd check that everything is properly connected.  I've had problems with colours disappearing due to a faulty connection in the VGA adaptor.
    Bob

  • Help Please! How can i get rid of shopper pro from my google chrome browser?

    Help Please! How can i get rid of shopper pro from my google chrome browser?

    Read this document about malware and adware.   The solution is almost certainly within.The Safe Mac
    http://www.adwaremedic.com/index.php
    Incidentally, it would help if you entered details of your products in your profile.   There are different answers for different items with this question.

  • Need a little help please    Airport Express

    Need a little help please.
    I am trying to set up a wireless network at my home using Airport Express.
    I have a regular phone line running in to I assume the modem. From there, there is an Ethernet cable running from that box to the back of the PC. My question is, I think, which of those do I unplug and plug into the Airport Express, the one on the back of the PC or the one that is in the back of the modem, or is this totally wrong.
    Any help would be appreciated…
    Thanks
    In advance…
    PS I have the manual but to me it is not very clear…

    Your connection sequence would look like this:
    Internet > Modem > AirPort Express >>>wireless to your computers.
    This means that you would unplug the cable that is now connected at the back of your PC and move that connection to the AirPort Express.
    Open Macintosh HD > Applications > Utilities > AirPort Utility
    Click Continue to follow the guided setup. On the third page, you will choose the option to "Create a wireless network" and continue the setup.

  • I need help please , i try to use itunes but my iPhone don't appear on itunes, i try everyting ,dowwload itunes again restart computer and iPhone,restart running device support,etc.

    i need help please , i try to use itunes but my iPhone don't appear on itunes, i try everyting ,dowwload itunes again restart computer and iPhone,restart running device support,etc.

    Windows doesn't detect iPhone: http://support.apple.com/kb/ts1538
    Mac: http://support.apple.com/kb/ts1591

  • How to use this method in JSTL?help me please!

    I know I can use "<C:set >" like as
    <c:set var="clabel3" value="${portalCustomizeBean.portalPage}"/> ,
    but now I want to use one method of portalCustomizeBean object not a attribute of it !!!!!
    who would tell me how to use?
    this is wrong in my code:
    <c:set var="clabel" value="${portalCustomizeBean.currentPageLabel}"/>
    <c:set var="clabel3" value="${portalCustomizeBean.toEntitiesExceptSpaceEscape(clabel)}"/>
    but how to use "toEntitiesExceptSpaceEscape" method in JSTL?????

    Why can't you just assign the method's return value to a variable and then print that? A bit of scriptlet code will do the trick. (As much as we all hate to use scriptlet code.)
    I believe you'll be able to do what you want in the 1.1 standard JSTL, but for now this will suffice. - MOD

  • Need a quick step by step how to use home share to import 500 songs in my Libruary into my little girls libruary

    need a quick step by step how to use home share to import 500 songs in my Libruary into my little girls libruary; her birthday is today - my five min action item has had me up since 2am - help me not be a failure today

    Hi there,
    So, is your daughter's library on a separate computer and running on the same Wifi as yours? Just need to establish the scenario.
    Cheers,
    GB

  • How to use addPasswordToPasswordHistory method

    Hi
    Can some one please tell me how to use the method addPasswordToPasswordHistory from the class WSUser.I have a requirement to add user password to password history whenever user changes his password through my custom password change workflow.Custom workflow changes the password in idm but it will not add the previous password to the password history.
    It will be helpfull if you paste the code to use this method
    Regards
    Karthik P

    Hi Amar
    Thanks for the reply
    I tried setting the password through setPassword method but its giving an exception ==>java.lang.NoSuchMethodException: java.lang.String.setPassword(com..waveset.util.EncrypteData)
    Then I decrypted the password but no luck getting ==>java.lang.NoSuchMethodException: java.lang.String.setPassword() exception.
    Am i missing something here.do i need to pass the encrypted password in byte array format? if yes how to do that.
    Here encrypted password is coming from a form.
    regards
    karthik p
    .

  • How to use set_encoding method to set encoding in ABAP Mapping

    Hi All,
      Can anyone please let me know how to use set_encoding method in ABAP Mapping to set encoding.
      Any help would be greatly appreciable.
    Regards,
    Dinakar

    Hi Stefan,
    Thanks for your info. Let me try in ABAP Forum.
    Regards,
    Dinakar

  • How to use isLast() method of Resultset ??

    When I use the isLast() method of Result, there is following error
    java.lang.AbstractMethodError
    What should I do ? and how to use isLast() method ?
    Thanks a lot :-)

    Really need your help, thanks again

  • How to use protected method in jsp code

    Could anyone tell me how to use protected method in jsp code ...
    I declare a Calendar class , and I want to use the isTimeSet method ,
    But if I write the code as follows ..
    ========================================================
    <%
    Calendar create_date = Calendar.getInstance();
    if (create_date.isTimeSet) System.out.println("true");
    %>
    ============================================================
    when I run this jsp , it appears the error wirtten "isTimeSet has protected access in java.util.Calendar"

    The only way to access a protected variable is to subclass.
    MyCalendar extends Calendar
    but I doubt you need to do this. If you only want to tell if a Calendar object has a time associated with it, try using
    cal.isSet( Calendar.HOUR );

  • How to use secondary method in workflow?

    Hi friends,
    can anyone plz let me know how to use secondary methods in workflow? it would be helpful if u explain with an example..
    thanks and regards,
    Arun.S

    Hi Arun Kumar,
    The Sec Method can be used in the user decision step. The secondary methods are executed along with the user decision step. You have 3 options. Either execute a secondary method before executing the user decision step or after execution of user decision step or while executing the user decision.
    For this define the methods either in Methods before execution of workitem execution to execute it before user decision step or Methods after execution of workitem so as to execute it after the execution of user decision.
    In order to execute a method along with user decision step execution use secondary methods (amodal call.)
    Let me know if you have any queries.
    Regards,
    Raj

Maybe you are looking for

  • OAM 11g Single Sign-On and OAM 11g Cookies

    Hi all, I need to know following, is it possible to get the username and password from the OAM 11g + IIS Webgate cookies and forward the same to the application for further authentication? is there any way to decrypt the cookie and use the informatio

  • Can't open big PDF attachment from Mail

    hi, guys: We have this issue with both iPad and iPad2. I have setup EXchange account and be able to download and read Emails. However, we found when we try to open big size (more than 1MB ) PDF. As matter of fact, we can't even download the size of f

  • It wont install the update

    I transfered some of my music from my old computer to my new one, when i try to listen to it, it asks for my password, which i give, then it tells me i need to update to the new version of iTunes to log in. I download the update, but when i get to th

  • Why ASP pages on desktop open in DW CS3

    Hello, I just completed the installation of CS3 on Win XP SP2 machine. Everything seems to work fine, except that when I click on an ASP file, with the windows explorer, located anywhere on my pc the file opens in Dreamweaver CS3 instead of in Intern

  • Layout problem in pdf

    Hi all, I have converted some reports from 6i to 10g, but have the followings problems when run in AS. 1. There are unwanted space inside a word. (eg. apple ---> a pple) 2. Some characters are closely packed together, the right side of a character 't