alti's Profile User Rating: -----

Reputation: 2 Apprentice
Group:
Active Members
Active Posts:
79 (0.04 per day)
Joined:
24-October 09
Profile Views:
3,880
Last Active:
User is offline Feb 23 2015 03:17 PM
Currently:
Offline

Previous Fields

Country:
GB
OS Preference:
Windows
Favorite Browser:
Who Cares
Favorite Processor:
Intel
Favorite Gaming Platform:
Who Cares
Your Car:
Who Cares
Dream Kudos:
0

Latest Visitors

Icon   alti has not set their status

Posts I've Made

  1. In Topic: Counting Text Characteristics in Text File

    Posted 23 Feb 2015

    View Poststill2blue, on 22 February 2015 - 04:31 PM, said:

    Okay well thanks for nothing. I have been 'reading' and 'googling' all day now. If those two things wrote code or helped me understand I wouldn't be here. Please excuse yourself from this thread, I'll go to another forum.

    HOW RUDE.....
  2. In Topic: Loop re-paint a Frame

    Posted 23 Feb 2015

    Actually I modified some other code I had, and it worked:
    Thanks for trying to help.

    import java.awt.*;
    import java.awt.event.*;
    import java.util.Random;
    import javax.swing.*;
    
    public class Repaint5 extends JPanel implements ActionListener {
    
    	public void paintComponent(Graphics g){
    		super.paintComponent(g);
    		int aa = getRandomValue();
    		g.setColor(Color.BLUE);
    		g.fillRect(75, 50, aa, 50);
    		g.drawString("BLUE  "+ aa, 250, 80);
    		System.out.println(aa);
    	}
    
    	private int getRandomValue() {
    		Random r = new Random();
    		int aa = r.nextInt(80 - 20 + 1) + 30;
    		return aa;
    	}
    	
    	@Override
    	public void actionPerformed(ActionEvent e) {repaint();}
    
    	public static void main(String[] args) {
    		JFrame f = new JFrame("Re-Paint");
    		f.setSize(400, 200);
    		f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    		f.setVisible(true);
    		Repaint5 re = new Repaint5();
            f.getContentPane().add(re);
    		Timer PointTimer = new Timer(1000, re);
    		PointTimer.setInitialDelay(1000);
    		PointTimer.start();
    	}
    }
    

My Information

Member Title:
D.I.C Head
Age:
43 years old
Birthday:
September 7, 1971
Gender:
Location:
London(UK)

Contact Information

E-mail:
Click here to e-mail me
Website URL:
Website URL  http://

Friends

Comments

alti has no profile comments yet. Why not say hello?