Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -3,18 +3,18 @@ import java.awt.Graphics;
|
|||
import javax.swing.JFrame;
|
||||
|
||||
public class DrawAPixel extends JFrame{
|
||||
public DrawAPixel() {
|
||||
super("Red Pixel");
|
||||
setSize(320, 240);
|
||||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
setVisible(true);
|
||||
}
|
||||
@Override
|
||||
public void paint(Graphics g) {
|
||||
g.setColor(new Color(255, 0, 0));
|
||||
g.drawRect(100, 100, 1, 1);
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
new DrawAPixel();
|
||||
}
|
||||
public DrawAPixel() {
|
||||
super("Red Pixel");
|
||||
setSize(320, 240);
|
||||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
setVisible(true);
|
||||
}
|
||||
@Override
|
||||
public void paint(Graphics g) {
|
||||
g.setColor(new Color(255, 0, 0));
|
||||
g.drawRect(100, 100, 1, 1);
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
new DrawAPixel();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,30 +4,30 @@ import java.awt.image.BufferedImage;
|
|||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
public class DrawAPixel extends JPanel{
|
||||
private BufferedImage puffer;
|
||||
private JFrame window;
|
||||
private Graphics g;
|
||||
public DrawAPixel() {
|
||||
window = new JFrame("Red Pixel");
|
||||
window.setSize(320, 240);
|
||||
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
window.setLayout(null);
|
||||
setBounds(0, 0, 320, 240);
|
||||
window.add(this);
|
||||
window.setVisible(true);
|
||||
}
|
||||
@Override
|
||||
public void paint(Graphics gr) {
|
||||
if(g == null) {
|
||||
puffer = (BufferedImage) createImage(getWidth(), getHeight());
|
||||
g = puffer.getGraphics();
|
||||
}
|
||||
g.setColor(new Color(255, 0, 0));
|
||||
g.drawRect(100, 100, 1, 1);
|
||||
gr.drawImage(puffer, 0, 0, this);
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
new DrawAPixel();
|
||||
}
|
||||
public class DrawAPixel extends JPanel{
|
||||
private BufferedImage puffer;
|
||||
private JFrame window;
|
||||
private Graphics g;
|
||||
public DrawAPixel() {
|
||||
window = new JFrame("Red Pixel");
|
||||
window.setSize(320, 240);
|
||||
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
window.setLayout(null);
|
||||
setBounds(0, 0, 320, 240);
|
||||
window.add(this);
|
||||
window.setVisible(true);
|
||||
}
|
||||
@Override
|
||||
public void paint(Graphics gr) {
|
||||
if(g == null) {
|
||||
puffer = (BufferedImage) createImage(getWidth(), getHeight());
|
||||
g = puffer.getGraphics();
|
||||
}
|
||||
g.setColor(new Color(255, 0, 0));
|
||||
g.drawRect(100, 100, 1, 1);
|
||||
gr.drawImage(puffer, 0, 0, this);
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
new DrawAPixel();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue