Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Graphics;
- import javax.swing.JFrame;
- public class Histogram {
- private Image img;
- private Graphics g;
- private int height = 600;
- private int width = 600;
- private JFrame frame;
- public Histogram(Image img) {
- this.img = img;
- this.frame = new JFrame("Histogram");
- this.initHistogram(true);
- }
- private void initHistogram(boolean visiblity) {
- this.frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- this.frame.setBounds(0, 0, this.width, this.height);
- this.frame.setVisible(visiblity);
- this.g = this.frame.getGraphics();
- // this.g.drawImage(this.img.getImage(), 0, 0, null);
- this.g.drawRect(10, 10, 100, 100);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement