1 Replies - 532 Views - Last Post: 20 February 2012 - 07:52 AM Rate Topic: -----

#1 vasanthbalaji  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 19-February 12

psuedocode for java program

Posted 20 February 2012 - 07:49 AM

try
        {
        int w = (text.length()*8)+7;
        int h=16;
        BufferedImage bf = new BufferedImage(w,h,BufferedImage.TYPE_INT_RGB);
        Graphics2D g = bf.createGraphics();
        g.setColor(Color.WHITE);
        g.fillRect(0, 0, w, h); 
        g.setColor(Color.BLACK);
        Font font = new Font("Courier", Font.BOLD, 14);
        g.setFont(font);
        g.drawString(text,1,10);
        g.dispose();
        File file = new File("c:/Basketball.png");
        ImageIO.write(bf, "png", file);
        JOptionPane.showMessageDialog(null, "Image has been created successfully.");
          
        }catch(Exception ex){         
          System.out.print(ex);              
        }
    }
      JFileChooser chooser=new JFileChooser();
         if(e.getSource()==i1)
         {
           
         chooser.setDialogTitle ("Choose Image..");  
         FileNameExtensionFilter filter =   
               new FileNameExtensionFilter("JPG ,PNG,GIF Images", "jpg","png","gif");  
               chooser.setFileFilter(filter);      
                int returnVal = chooser.showDialog(this, "Choose..");  
                File file = null;  
                          
                if (returnVal == JFileChooser.APPROVE_OPTION)  
                    file = chooser.getSelectedFile();  
                
                    Image image = null;  
                      try
                      {
                            
                          ImageIcon imgIcon = new ImageIcon(file.getPath());
                          Image img = imgIcon.getImage();
                          Graphics g = getGraphics();
                          g.drawImage(img,50,100,imgIcon.getIconWidth(),imgIcon.getIconHeight(),this);
                          g.dispose();





sir/madam i have searched many sites how to write psuedocode for java program.but i didnt got any idea about this.please help me how to write psuedocode for java program

Is This A Good Question/Topic? 0
  • +

Replies To: psuedocode for java program

#2 macosxnerd101  Icon User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12278
  • View blog
  • Posts: 45,364
  • Joined: 27-December 08

Re: psuedocode for java program

Posted 20 February 2012 - 07:52 AM

Pseudocode is a fancy way of saying that you are outlining your logic in a programatic way using constructs like if statements, loops, and functions, but in a language-agnostic manner.
Was This Post Helpful? 2
  • +
  • -

Page 1 of 1