Why the oval is not showing up?

heres my code:
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
public class myApplet extends java.applet.Applet {
boolean initialization = true;
int centerX, centerY, maxX, maxY;
float pixelSize, rWidth = 400.0F, rHeight = 400.0F;
BufferedImage gBuffer;
void initializeGraphics()
Dimension d = canvas1.getSize();
maxX = d.width - 1; maxY = d.height - 1;
pixelSize = Math.max((rWidth)/maxX, (rHeight)/maxY);
centerX = maxX/2; centerY = maxY/2;
int iX(float x){return Math.round(centerX + x/pixelSize);}
int iY(float y){return Math.round(centerY - y/pixelSize);}
float fx(int x){return ((x - centerX) * pixelSize);}
float fy(int y){return ((centerY - y) * pixelSize);}
void clearGraphics(Graphics g) {
g.setColor(Color.WHITE);
g.fillRect(0,0, maxX, maxY);
/** Initializes the applet Trans2D */
public void init() {
try {
java.awt.EventQueue.invokeAndWait(new Runnable() {
public void run() {
initComponents();
} catch (Exception ex) {
ex.printStackTrace();
this.setSize(700, 700);
gBuffer = new BufferedImage((int)rWidth, (int)rHeight, BufferedImage.TYPE_INT_ARGB);
/** This method is called from within the init() method to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
canvas1 = new mycanvas();
jScrollBarPoints = new javax.swing.JScrollBar();
jLabelNoPoints = new javax.swing.JLabel();
canvas1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
canvas1MousePressed(evt);
jScrollBarPoints.setMaximum(25);
jScrollBarPoints.setMinimum(3);
jScrollBarPoints.setOrientation(javax.swing.JScrollBar.HORIZONTAL);
jScrollBarPoints.addAdjustmentListener(new java.awt.event.AdjustmentListener() {
public void adjustmentValueChanged(java.awt.event.AdjustmentEvent evt) {
jScrollBarPointsAdjustmentValueChanged(evt);
jLabelNoPoints.setText("3");
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(org.jdesktop.layout.GroupLayout.LEADING, jScrollBarPoints, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.LEADING, canvas1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE))
.add(18, 18, 18)
.add(jLabelNoPoints, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 30, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(296, 296, 296))
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLabelNoPoints)
.add(layout.createSequentialGroup()
.add(jScrollBarPoints, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(canvas1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 452, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
.add(20, 20, 20))
}// </editor-fold>
private void canvas1MousePressed(java.awt.event.MouseEvent evt) {                                    
// TODO add your handling code here:
Graphics g = gBuffer.getGraphics();
g.drawOval(evt.getX(), evt.getY(), 10, 10);
g.fillOval(evt.getX(), evt.getY(), 10, 10);
private void jScrollBarPointsAdjustmentValueChanged(java.awt.event.AdjustmentEvent evt) {                                                       
jLabelNoPoints.setText(""+jScrollBarPoints.getValue());
// Variables declaration - do not modify
private java.awt.Canvas canvas1;
private javax.swing.JLabel jLabelNoPoints;
private javax.swing.JScrollBar jScrollBarPoints;
// End of variables declaration
public class mycanvas extends java.awt.Canvas {
public void paint(Graphics g){
super.paint(g);
my question is.when i press with the mouse on canvas1 why it doesnt draw an oval in that X,Y ? How can I solve that? Thanks!

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
public class myApplet extends java.applet.Applet {
boolean initialization = true; 
int centerX, centerY, maxX, maxY;
float pixelSize, rWidth = 400.0F, rHeight = 400.0F;
BufferedImage gBuffer;
void initializeGraphics()
   Dimension d = canvas1.getSize();
   maxX = d.width - 1; maxY = d.height - 1;
   pixelSize = Math.max((rWidth)/maxX, (rHeight)/maxY);
   centerX = maxX/2; centerY = maxY/2;
  int iX(float x){return Math.round(centerX + x/pixelSize);}
  int iY(float y){return Math.round(centerY - y/pixelSize);}
  float fx(int x){return ((x - centerX) * pixelSize);}
  float fy(int y){return ((centerY - y) * pixelSize);}
void clearGraphics(Graphics g) {
    g.setColor(Color.WHITE);
    g.fillRect(0,0, maxX, maxY);
    /** Initializes the applet Trans2D */
    public void init() {
        try {
            java.awt.EventQueue.invokeAndWait(new Runnable() {
                public void run() {
                    initComponents();
        } catch (Exception ex) {
            ex.printStackTrace();
        this.setSize(700, 700);
        gBuffer = new BufferedImage((int)rWidth, (int)rHeight, BufferedImage.TYPE_INT_ARGB);
    /** This method is called from within the init() method to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
    // <editor-fold defaultstate="collapsed" desc="Generated Code">                         
    private void initComponents() {
        canvas1 = new mycanvas();
        jScrollBarPoints = new javax.swing.JScrollBar();
        jLabelNoPoints = new javax.swing.JLabel();
        canvas1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                canvas1MousePressed(evt);
        jScrollBarPoints.setMaximum(25);
        jScrollBarPoints.setMinimum(3);
        jScrollBarPoints.setOrientation(javax.swing.JScrollBar.HORIZONTAL);
        jScrollBarPoints.addAdjustmentListener(new java.awt.event.AdjustmentListener() {
            public void adjustmentValueChanged(java.awt.event.AdjustmentEvent evt) {
                jScrollBarPointsAdjustmentValueChanged(evt);
        jLabelNoPoints.setText("3");
        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, jScrollBarPoints, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, canvas1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE))
                .add(18, 18, 18)
                .add(jLabelNoPoints, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 30, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(296, 296, 296))
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabelNoPoints)
                    .add(layout.createSequentialGroup()
                        .add(jScrollBarPoints, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(canvas1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 452, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                .add(20, 20, 20))
    }// </editor-fold>                       
    private void canvas1MousePressed(java.awt.event.MouseEvent evt) {                                    
        Graphics g = gBuffer.getGraphics ();
        g.setColor (Color.RED);
        g.fillOval (evt.getX (), evt.getY (), 10, 10);
        g.setColor (Color.BLUE);
        g.drawOval (evt.getX(), evt.getY(), 10, 10);
    private void jScrollBarPointsAdjustmentValueChanged(java.awt.event.AdjustmentEvent evt) {                                                       
        jLabelNoPoints.setText(""+jScrollBarPoints.getValue());
    // Variables declaration - do not modify                    
    private java.awt.Canvas canvas1;
    private javax.swing.JLabel jLabelNoPoints;
    private javax.swing.JScrollBar jScrollBarPoints;
    // End of variables declaration                  
    public class mycanvas extends java.awt.Canvas {
        public void paint(Graphics g){
            super.paint (g);
            g.drawImage (gBuffer, 0, 0, null);
}still nothing? is it so difficult to do such an easy thing?

Similar Messages

  • Why the iPhone dose not show the witting in case if the other person have a call and I'm on witting?

    Why the iPhone dose not show the witting in case if the other person have a call and I'm on witting? really I'm dissappointed with this point Why we do not have this service?

    That is not a feature of the iPhone (or of any phone I've ever had so apparently it's far from universal). Apple has not said why they have no such feature.
    You can request such a feature here:
    http://www.apple.com/feedback
    Either the person you're calling will answer you or they won't. What difference does it make why?

  • Do anyone know why the desktops do not show? Is this a bug?

    Do anyone know why the desktops do not show?

    See:
    * http://kb.mozillazine.org/Images_or_animations_do_not_load
    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]

  • Why the Itune is not showing my iphone in it???

    I m using Iphone 5s and i want to copy songs and some other stuff from my pc to my iphone. I searched for it on google and read some discussion on the official site of APPLE, acc. to them i need Itune to do so. I downloaded it from the apple site but when i connect my Iphone to my pc then The Itune  does not show my IPhone anywhere... plz help

    Hey nrathi,
    Thanks for using Apple Support Communities.
    Follow this article since the iPhone does not appear under Devices in iTunes.
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/ts1538
    Have a nice day,
    Mario

  • Why the Image is not showing on Report at runtime?

    Post Author: azharrahi
    CA Forum: .NET
    I am working on a web site which was developed in ASP.Net 1.1. This web site also contains Crystal Reports version 9.
    Now I have loaded the web site in Visual Studio.net 2005 and hence in ASP.Net 2.0. Still the Crystal reports version is 9.
    Everything is ok and Crystal reports are showing data properly.
    But one thing is very strange and annoyable.i.e. When I insert image on Crystal Reports through right click-> Insert->Picture, the image is shown in the design time preview of report, but when I load the Crystal Report on .Net control CrystalReportViewer and run the application, the Image is not displayed. The problem becomes more strange when I Export the Crystal Report to PDF file and MS Excel. Strangely the Image is also exported there and is displayed. Whats the problem? Why Image is not displayed on the CrystalreportViewer of the form on run time and why on exporting to PDF file and MS Excel, it is displayed? Can any body tell me whats the problem behind of not displaying image on runtime?
    At least it means that Image is embeded and loaded on runtime. Only now viewing. Only a blank Picture box displayed.

    Post Author: Argan
    CA Forum: .NET
    A couple things can cause this.
    Right click on the red x to find out the name of the png file.  Search the web server for that png and make sure that the asp worker has access to it.
    The other is a image handler issue.  Search the kbase for Red X NET 2005 and you will find a kbase or two that addresses this.

  • Why the Image dose not show?

    the program can run, however, the image just dose not show on the container, I've mad ....
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.image.*;
    import java.awt.geom.*;
    import javax.imageio.*;
    import java.io.*;
    public class gui extends JFrame{
    private stack s=new stack();
    private queue q1=new queue();
    private queue q2=new queue();
    private JRadioButton rbutton1,rbutton2,rbutton3,rbutton4,rbutton5;
    private JTextArea point1,point2,infoarea;
    private JButton ok ,exit;
    int state=0;
    private JLabel b=new JLabel(new ImageIcon("abc.jpg"));
    public gui() {    
    creatUserInterface();
    private void creatUserInterface(){
    Container contentPane=getContentPane();
    contentPane.setLayout(null);
    b.setBounds(0, 0,127,127);
    contentPane.add(b);
    rbutton1=new JRadioButton();
    rbutton1.setBounds(45, 270, 20,20);
    rbutton1.setBackground(Color.decode("170800"));
    contentPane.add(rbutton1);
    rbutton2=new JRadioButton();
    rbutton2.setBounds(145, 270, 20,20);
    rbutton2.setBackground(Color.decode("170800"));
    contentPane.add(rbutton2);
    rbutton3=new JRadioButton();
    rbutton3.setBounds(245, 270, 20,20);
    rbutton3.setBackground(Color.decode("170800"));
    contentPane.add(rbutton3);
    rbutton4=new JRadioButton();
    rbutton4.setBounds(345, 270, 20,20);
    rbutton4.setBackground(Color.decode("170800"));
    contentPane.add(rbutton4);
    rbutton5=new JRadioButton();
    rbutton5.setBounds(445, 270, 20,20);
    rbutton5.setBackground(Color.decode("170800"));
    contentPane.add(rbutton5);
    point1=new JTextArea();
    point1.setBounds(585, 20, 43, 20);
    contentPane.add(point1);
    point2=new JTextArea();
    point2.setBounds(585, 205, 43, 20);
    contentPane.add(point2);
    infoarea=new JTextArea();
    infoarea.setBounds(30, 300, 450, 100);
    infoarea.setText("click \"ok \" to start game, click \"exit \" to exit");
    contentPane.add(infoarea);
    ok=new JButton();
    ok.setBounds(520, 255, 75, 60);
    ok.setText("OK");
    contentPane.add(ok);
    ok.addActionListener(
    new ActionListener(){
    public void actionPerformed(ActionEvent event){          
    okButton(event);
    exit=new JButton();
    exit.setBounds(520, 340, 75, 65);
    exit.setText("EXIT");
    contentPane.add(exit);
    exit.addActionListener(
    new ActionListener(){
    public void actionPerformed(ActionEvent event){          
    exitButton(event);
    contentPane.setBackground(Color.decode("170800"));
    setTitle("Change it or Not");
    setSize(640, 480);
    setVisible(true);
    Message was edited by:
    explosivealan

    because the code is very long and i just cut the code i think is not related, i post all the code here, should i post the code of stack , queue and others class?My objective is to show all cardLabel as jpg, abc is to test only.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.image.*;
    import java.awt.geom.*;
    import javax.imageio.*;
    import java.io.*;
    public class gui extends JFrame{
        private stack s=new stack();                                      // a stack with 52 node to store 52 cards
        private queue q1=new queue();                                     // a queue to hold the computer player's cards
        private queue q2=new queue();                                     // a queue to hold the human player's cards
        private cardoperation op=new cardoperation();                    // contain all card operation that require to run the game       
        private handcompare hc=new handcompare();                        // pass two queue to handcompare, if the first queue defealt the second queue, return true, otherwise reture false
        private JLabel cardlabel1,cardlabel2,cardlabel3,cardlabel4,cardlabel5,cardlabel6,cardlabel7,cardlabel8,cardlabel9,cardlabel10;     // label to show the cards
        private JLabel computerpoint,playerpoint,inputbet,dollarsign;        
        private JRadioButton rbutton1,rbutton2,rbutton3,rbutton4,rbutton5;   //radio button for selecting which card to be changed
        private JTextField bet;                                               //Textfield to input the amount of bet
        private JTextArea point1,point2,infoarea;                             //textarea to show player's point and futher infomation;
        private JButton ok ,exit;                                             //button to confirm or to exit game
        int compoint=10000,playpoint=10000;                                    // integer to store the player's current point;'
        int betamount;                                                         // integer to store the current bet amount
        int state=0;                                                           // store the state of the program
        private JLabel b=new JLabel(new ImageIcon("abc.jpg"));
        public gui() {    
            super();
            creatUserInterface();
        private void creatUserInterface(){
        Container contentPane=getContentPane();   
        contentPane.setLayout(null);
        cardlabel1=new JLabel();
        cardlabel1.setBounds(50, 15, 50, 30);
        cardlabel1.setText("");
        contentPane.add(cardlabel1);
        b.setBounds(0, 0,127,127);
        contentPane.add(b);
        cardlabel2=new JLabel();
        cardlabel2.setBounds(150, 15, 50, 30);
        cardlabel2.setText("");
        contentPane.add(cardlabel2);
        cardlabel3=new JLabel();
        cardlabel3.setBounds(250, 15, 50, 30);
        cardlabel3.setText("");
        contentPane.add(cardlabel3);
        cardlabel4=new JLabel();
        cardlabel4.setBounds(350, 15, 50, 30);
        cardlabel4.setText("");
        contentPane.add(cardlabel4);
        cardlabel5=new JLabel();
        cardlabel5.setBounds(450, 15, 50, 30);
        cardlabel5.setText("");
        contentPane.add(cardlabel5);
        cardlabel6=new JLabel();
        cardlabel6.setBounds(50, 200, 50, 30);
        cardlabel6.setText("");
        contentPane.add(cardlabel6);
        cardlabel7=new JLabel();
        cardlabel7.setBounds(150, 200, 50, 30);
        cardlabel7.setText("");
        contentPane.add(cardlabel7);
        cardlabel8=new JLabel();
        cardlabel8.setBounds(250, 200, 50, 30);
        cardlabel8.setText("");
        contentPane.add(cardlabel8);
        cardlabel9=new JLabel();
        cardlabel9.setBounds(350, 200, 50, 30);
        cardlabel9.setText("");
        contentPane.add(cardlabel9);
        cardlabel10=new JLabel();
        cardlabel10.setBounds(450, 200, 50, 30);
        cardlabel10.setText("");
        contentPane.add(cardlabel10);
        rbutton1=new JRadioButton();
        rbutton1.setBounds(45, 270, 20,20);
        rbutton1.setBackground(Color.decode("170800"));
        contentPane.add(rbutton1);
        rbutton2=new JRadioButton();
        rbutton2.setBounds(145, 270, 20,20);
        rbutton2.setBackground(Color.decode("170800"));
        contentPane.add(rbutton2);
        rbutton3=new JRadioButton();
        rbutton3.setBounds(245, 270, 20,20);
        rbutton3.setBackground(Color.decode("170800"));
        contentPane.add(rbutton3);
        rbutton4=new JRadioButton();
        rbutton4.setBounds(345, 270, 20,20);
        rbutton4.setBackground(Color.decode("170800"));
        contentPane.add(rbutton4);
        rbutton5=new JRadioButton();
        rbutton5.setBounds(445, 270, 20,20);
        rbutton5.setBackground(Color.decode("170800"));
        contentPane.add(rbutton5);
        computerpoint=new JLabel();
        computerpoint.setBounds(500, 15, 80, 30);
        computerpoint.setText("computer has");
        contentPane.add(computerpoint);
        playerpoint=new JLabel();
        playerpoint.setBounds(500, 200, 80, 30);
        playerpoint.setText("you have");
        contentPane.add(playerpoint);
        inputbet=new JLabel();
        inputbet.setBounds(500, 90, 130, 20);
        inputbet.setText("please input bet here");
        contentPane.add(inputbet);   
        dollarsign=new JLabel();
        dollarsign.setBounds(510, 115, 20, 20);
        dollarsign.setText("$");
        contentPane.add(dollarsign);   
        point1=new JTextArea();
        point1.setBounds(585, 20, 43, 20);   
        contentPane.add(point1);  
        point2=new JTextArea();
        point2.setBounds(585, 205, 43, 20);
        contentPane.add(point2);  
        infoarea=new JTextArea();
        infoarea.setBounds(30, 300, 450, 100);
        infoarea.setText("click \"ok \" to start game, click \"exit \" to exit");
        contentPane.add(infoarea);
        bet=new JTextField();
        bet.setBounds(530, 115, 60, 20);
        contentPane.add(bet);  
        ok=new JButton();
        ok.setBounds(520, 255, 75, 60);
        ok.setText("OK");
        contentPane.add(ok);
        ok.addActionListener(
                    new ActionListener(){
               public void actionPerformed(ActionEvent event){          
                 okButton(event);
        exit=new JButton();
        exit.setBounds(520, 340, 75, 65);
        exit.setText("EXIT");
        contentPane.add(exit);
        exit.addActionListener(
                    new ActionListener(){
               public void actionPerformed(ActionEvent event){          
                 exitButton(event);
        contentPane.setBackground(Color.decode("170800"));
        setTitle("Change it or Not");
        setSize(640, 480);
        setVisible(true);
        private void displayLabel(){
            int a[]=new int[5];
            int b[]=new int[5];
            String a1[]=new String[5];
            String b1[]=new String[5];
            a=q1.copy_queue();
            b=q2.copy_queue();
            int i;
                for(i=0;i<5;i++){
            if(a%100==13) a1[i]="A";
    else if(a[i]%100>0&&a[i]%100<10)a1[i]=String.valueOf(a[i]%100+1);
    else if(a[i]%100==10)a1[i]="J";
    else if(a[i]%100==11)a1[i]="Q";
    else if(a[i]%100==12)a1[i]="K";
    for(i=0;i<5;i++){
    if(b[i]%100==13) b1[i]="A";
    else if(b[i]%100>0&&b[i]%100<10)b1[i]=String.valueOf(b[i]%100+1);
    else if(b[i]%100==10)b1[i]="J";
    else if(b[i]%100==11)b1[i]="Q";
    else if(b[i]%100==12)b1[i]="K";
    cardlabel1.setText(a1[0]);
    if(a[0]/100==4)
    cardlabel1.setForeground(Color.PINK);
    else if(a[0]/100==3)
    cardlabel1.setForeground(Color.BLUE);
    else if(a[0]/100==2)
    cardlabel1.setForeground(Color.RED);
    else if(a[0]/100==1)
    cardlabel1.setForeground(Color.BLACK);
    cardlabel2.setText(a1[1]);
    if(a[1]/100==4)
    cardlabel2.setForeground(Color.PINK);
    else if(a[1]/100==3)
    cardlabel2.setForeground(Color.BLUE);
    else if(a[1]/100==2)
    cardlabel2.setForeground(Color.RED);
    else if(a[1]/100==1)
    cardlabel2.setForeground(Color.BLACK);
    cardlabel3.setText(a1[2]);
    if(a[2]/100==4)
    cardlabel3.setForeground(Color.PINK);
    else if(a[2]/100==3)
    cardlabel3.setForeground(Color.BLUE);
    else if(a[2]/100==2)
    cardlabel3.setForeground(Color.RED);
    else if(a[2]/100==1)
    cardlabel3.setForeground(Color.BLACK);
    cardlabel4.setText(a1[3]);
    if(a[3]/100==4)
    cardlabel4.setForeground(Color.PINK);
    else if(a[3]/100==3)
    cardlabel4.setForeground(Color.BLUE);
    else if(a[3]/100==2)
    cardlabel4.setForeground(Color.RED);
    else if(a[3]/100==1)
    cardlabel4.setForeground(Color.BLACK);
    cardlabel5.setText(a1[4]);
    if(a[4]/100==4)
    cardlabel5.setForeground(Color.PINK);
    else if(a[4]/100==3)
    cardlabel5.setForeground(Color.BLUE);
    else if(a[4]/100==2)
    cardlabel5.setForeground(Color.RED);
    else if(a[4]/100==1)
    cardlabel5.setForeground(Color.BLACK);
    cardlabel6.setText(b1[0]);
    if(b[0]/100==4)
    cardlabel6.setForeground(Color.PINK);
    else if(b[0]/100==3)
    cardlabel6.setForeground(Color.BLUE);
    else if(b[0]/100==2)
    cardlabel6.setForeground(Color.RED);
    else if(b[0]/100==1)
    cardlabel6.setForeground(Color.BLACK);
    cardlabel7.setText(b1[1]);
    if(b[1]/100==4)
    cardlabel7.setForeground(Color.PINK);
    else if(b[1]/100==3)
    cardlabel7.setForeground(Color.BLUE);
    else if(b[1]/100==2)
    cardlabel7.setForeground(Color.RED);
    else if(b[1]/100==1)
    cardlabel7.setForeground(Color.BLACK);
    cardlabel8.setText(b1[2]);
    if(b[2]/100==4)
    cardlabel8.setForeground(Color.PINK);
    else if(b[2]/100==3)
    cardlabel8.setForeground(Color.BLUE);
    else if(b[2]/100==2)
    cardlabel8.setForeground(Color.RED);
    else if(b[2]/100==1)
    cardlabel8.setForeground(Color.BLACK);
    cardlabel9.setText(b1[3]);
    if(b[3]/100==4)
    cardlabel9.setForeground(Color.PINK);
    else if(b[3]/100==3)
    cardlabel9.setForeground(Color.BLUE);
    else if(b[3]/100==2)
    cardlabel9.setForeground(Color.RED);
    else if(b[3]/100==1)
    cardlabel9.setForeground(Color.BLACK);
    cardlabel10.setText(b1[4]);
    if(b[4]/100==4)
    cardlabel10.setForeground(Color.PINK);
    else if(b[4]/100==3)
    cardlabel10.setForeground(Color.BLUE);
    else if(b[4]/100==2)
    cardlabel10.setForeground(Color.RED);
    else if(b[4]/100==1)
    cardlabel10.setForeground(Color.BLACK);
    point1.setText("$"+String.valueOf(compoint)); //show the value back if player has change it accdentially
    point2.setText("$"+String.valueOf(playpoint));
    if(betamount==0)
    bet.setText("");
    else
    bet.setText(String.valueOf(betamount));
    private void displayHalf(){
    int b[]=new int[5];
    String b1[]=new String[5];
    b=q2.copy_queue();
    int i;
    for(i=0;i<5;i++){
    if(b[i]%100==13) b1[i]="A";
    else if(b[i]%100>0&&b[i]%100<10)b1[i]=String.valueOf(b[i]%100+1);
    else if(b[i]%100==10)b1[i]="J";
    else if(b[i]%100==11)b1[i]="Q";
    else if(b[i]%100==12)b1[i]="K";
    cardlabel6.setText(b1[0]);
    if(b[0]/100==4)
    cardlabel6.setForeground(Color.PINK);
    else if(b[0]/100==3)
    cardlabel6.setForeground(Color.BLUE);
    else if(b[0]/100==2)
    cardlabel6.setForeground(Color.RED);
    else if(b[0]/100==1)
    cardlabel6.setForeground(Color.BLACK);
    cardlabel7.setText(b1[1]);
    if(b[1]/100==4)
    cardlabel7.setForeground(Color.PINK);
    else if(b[1]/100==3)
    cardlabel7.setForeground(Color.BLUE);
    else if(b[1]/100==2)
    cardlabel7.setForeground(Color.RED);
    else if(b[1]/100==1)
    cardlabel7.setForeground(Color.BLACK);
    cardlabel8.setText(b1[2]);
    if(b[2]/100==4)
    cardlabel8.setForeground(Color.PINK);
    else if(b[2]/100==3)
    cardlabel8.setForeground(Color.BLUE);
    else if(b[2]/100==2)
    cardlabel8.setForeground(Color.RED);
    else if(b[2]/100==1)
    cardlabel8.setForeground(Color.BLACK);
    cardlabel9.setText(b1[3]);
    if(b[3]/100==4)
    cardlabel9.setForeground(Color.PINK);
    else if(b[3]/100==3)
    cardlabel9.setForeground(Color.BLUE);
    else if(b[3]/100==2)
    cardlabel9.setForeground(Color.RED);
    else if(b[3]/100==1)
    cardlabel9.setForeground(Color.BLACK);
    cardlabel10.setText(b1[4]);
    if(b[4]/100==4)
    cardlabel10.setForeground(Color.PINK);
    else if(b[4]/100==3)
    cardlabel10.setForeground(Color.BLUE);
    else if(b[4]/100==2)
    cardlabel10.setForeground(Color.RED);
    else if(b[4]/100==1)
    cardlabel10.setForeground(Color.BLACK);
    cardlabel1.setText("");
    cardlabel2.setText("");
    cardlabel3.setText("");
    cardlabel4.setText("");
    cardlabel5.setText("");
    point1.setText("$"+String.valueOf(compoint)); //show the value back if player has change it accdentially
    point2.setText("$"+String.valueOf(playpoint));
    if(betamount==0)
    bet.setText("");
    else
    bet.setText(String.valueOf(betamount));
    private void okButton(ActionEvent event){
    switch(state){
    case(0):{
    op.reshuffle(s);
    op.CardDistribe(s, q1, q2);
    displayHalf();
    infoarea.setText("please input your bet and click \"ok \" \n\nSpace is Black Heart is Red \nClub is Bleu Diamond is Pink");
    break;
    case(1):{  
    try{
    betamount=Integer.parseInt(bet.getText());
    catch(NumberFormatException e){
    infoarea.setText("invaild input, please try again");
    state=state-1;
    if(state==1)
    if(betamount<=0||betamount>playpoint)
    {infoarea.setText("please input between 1 & "+String.valueOf(playpoint));
                           state=state-1;}
    else
    {infoarea.setText("please choose the cards to be changed \n\nSpace is Black    Heart is Red \nClub is Bleu         Diamond is Pink"); 
                           displayLabel();}
    break;
    case(2):{           
    infoarea.setText("choosed card has been changed");
    int a[]=new int[5];
    for(int i=0;i<5;i++)
    a[i]=0;
    if(rbutton1.isSelected())
    a[0]=1;
    if(rbutton2.isSelected())
    a[1]=1;
    if(rbutton3.isSelected())
    a[2]=1;
    if(rbutton4.isSelected())
    a[3]=1;
    if(rbutton5.isSelected())
    a[4]=1;
    op.computerChangeCard(s, q1, hc);
    op.playerChangeCard(s, q2, a);
    displayLabel();
    break;
    case(3):{          
    if(hc.compare(q1, q2)){
    infoarea.setText("you loss\n\nclick \"ok \" to continue");
    playpoint=playpoint-betamount;
    compoint=compoint+betamount;
    else{
    infoarea.setText("you win\n\nclick \"ok \" to continue");
    playpoint=playpoint+betamount;
    compoint=compoint-betamount;
    betamount=0;
    displayLabel();
    if(playpoint<=0)
    infoarea.setText("you have loss the game, press \"ok \" or \"exit \" to end game");
    else if(compoint<=0)
    infoarea.setText("you have win the game, press \"ok \" or \"exit \" to end game");
    else{
    state=-1;
    break;
    case(4):{
    exit(); // player's point <=0, so force to exit'
    default:
    rbutton1.setSelected(false);
    rbutton2.setSelected(false);
    rbutton3.setSelected(false);
    rbutton4.setSelected(false);
    rbutton5.setSelected(false);
    state=state+1;
    private void exitButton(ActionEvent event){
    exit();
    private void exit(){
    System.exit(0);

  • Why the subvi can not show,when i use call by reference node.

    I used a call by reference node in function pallete,i follow the labview manuals and examples(dynamic load example), but i can not see the subvi show when the program running.
    Attachments:
    comshow.vi ‏75 KB
    交流稳态频谱.vi ‏19 KB

    Hi Sunny,
    Open your subVI,
    1. go to File->Vi Properties (or Ctrl+I)
    2. choose Window Appearance category
    3. choose Customize
    4. check "Show Front Panel When Called" (and "Close Afterwards ..")
    5. save the VI, close it and try again.
    Let us know if it's OK ...

  • Why when using Adobe Bridge,  I apply a star rating,  the rating does not show up in Photoshop Elements? [tags]

    Why when using Adobe Bridge,  I apply a star rating,   the rating does not show up in Photoshop Elements.  I use Elements as my organizer and Bridge to view as it is much more user friendly.  Anyone any solutions??

    Most likely you have set the wrong file as the external editor. You don't want the obvious one; that's just a link to the welcome screen. Go back and choose this one, which is hidden away inside the folder Support Files:

  • Why isn't the edit button not showing in my ESX24 sampler?

    why isn't the edit button not showing in my ESX24 sampler?

    Is that during installation when you see the two icons.. the one on the left looking like a Garageband guitar icon, the one on the right like the Logic Pro platimum record icon?
    Yes.. that one.. with the choice to click on which option you want/are coming from...
    p.s. I'll probably aquire a Mac Mini this fall then upgrade.... I mean repurchase!
    I think I managed to grab one of the last of the 2011 refurb'ed MMS's.... at that super low price Apple were selling them for... before they bumped it up and now, they seem to have none left at all at any price
    However, just in case, I have found this site really useful at keeping track of Apple's refurb stock... and pricing
    http://www.refurb.me/us/

  • Why are my movies not showing on my Mac Book, which is the computer that I used to purchase the movie, but showing on my IMAC at home...I am currently deployed.

    why are my movies not showing on my Mac Book, which is the computer that I used to purchase the movie, but showing on my IMAC at home...I am currently deployed so this ***** a bit. Also how do I keep this incedent from happending in the future?

    No, this is not the case. I know where i purchased the movie and I also know movies cant be added to the cloud such as music, TV shows can.  The instance happened during the dowload. I think that depending which computer is up and running and the bandwith allocated on either network, which ever computer that finishes first is the one that gets the movie. Just a thought. So next time I will ensure my IMAC is not running. I think that fixes it.
    Thanks

  • TS2972 why is the import button not showing at the button right hand corner of iTunes?

    why is the import button not showing at the bottom right hand corner of my ITunes page.  I am trying to transfer files from my home share library onto a new computers library.

    See if it isn't hidden under the View menu. iTunes- Turning on iTunes menus in Windows 8 and 7.

  • When I sync iphone to itunes, why do my soundtracks not show as albums but via artist?  IE: Pulp Fiction has 16 songs by different artists.  In itunes I can pull up pulp fiction and play the 16 songs.  In iphone sync the 16 songs are seperate

    When I sync iphone to itunes, why do my soundtracks not show as albums but via artist?  IE: Pulp Fiction has 16 songs by different artists.  In itunes I can pull up pulp fiction and play the 16 songs.  In iphone sync the 16 songs are seperate and listed by Al Green, cowboy junkies etc... How to fix this so the ipod part of my iphone will show & play the soundtracks as albums... thanks.

    What is selected under the Music tab for your iPhone sync preferences with iTunes?
    If you have chosen selected playlists, artists, albums, and genres - if Pulp Fiction is available under the Albums section to be selected as an Album to be transferred to your iPhone, is it selected?
    If so, when you select Albums via the iPod on your iPhone, the album is not available there to select?
    You can always create an iTunes playlist with these songs placing the songs in your preferred order.

  • Why the content of the Explain Plan not show out?

    Why the content of the Explain Plan not show out?
    I am using Oracle 11g.
    I already ran the utlxplan.sql sctipt and I also set serveroutput on.
    SQL> set autotrace on
    SQL> EXPLAIN PLAN FOR SELECT*FROM DEMO_TABLE WHERE OWNER='HR';
    Explained.
    Elapsed: 00:00:00.67

    When you say:
    My release 10.2 database display the Explain Plan automatically.
    How to make 11.1.0.6 Oracle database to display the Explain Plan automatically.What do you mean? Specifically, what commands are you executing in the 10.2 database, that displays the execution plan "automatically"?
    Are you saying that if you execute the same command in 11.1.0.6, you don't get a similar result? What happens? Do you get an error?
    For both the 10.2 case and the 11.1.0.6 case, post the full output of the commands you're executing, and the result you are seeing.
    Then, maybe someone can help you.
    When you post the output, please encapsulate it in a pair "code" tags, which is the word "code" without the quotes, surrounded by a pair of curly braces {}.
    When you do this correctly, the output looks like:
    This is output from my execution plan run.and is much easier to read.
    Don't be afraid to use the preview tab to see if your message will be posted with the correct formatting.
    -Mark

  • Why does my music not show up in the iCloud?

    Why does my music not show up in the icloud?

    A slight confusion on my part. I have just discovered that it is all saved on itunes. Many thanks.

  • Why doesn't my "notes" show within mail sidebar since the Maverick update?

    Why doesn't my "notes" show within mail sidebar since the Maverick update?

    Doing it over Wifi?  I was having the same issue.  I restarted my router and voila. 

Maybe you are looking for

  • String To File simulation,  viewing data from a string?

    Hi, I am working on an imaging system. I get returned a string with data which can be in a number of different formats - .jpg, .PDF, .doc etc... I also get back mime data type, if I want to use it. My initial idea was to call the function: CALL FUNCT

  • Creating Sales Order- Item Category TAN is not defined.

    Hello all, I am working on Creating sales order for Global Bike Inc case. But when I enter the material and quantity number and click check mark it says "Item category TAN is not defined". Can some body help me how can we define TAN or why it is givi

  • Number of plays and last play date are not updated in the iPhone 5.

    I am managing music manually, and play music using the regualy player and in my car through blue tooth, but the number of plays doesn't update. I have lists for new music, based on number of plays, and it never changes.

  • How do i get an iTunes file to my friends?

    As an old bat, i don't have too much computer knowledge.  i did manage to creat a 14 minute slideshow and moved it to iTunes.  Now, how do I send this to friends or get it on the Web? 

  • How to install TOP command

    Can anyone guide me how to install TOP command in solaris 10, 64bit OS? thanks