Skip to content

Instantly share code, notes, and snippets.

@AlexFrazer
Last active December 11, 2015 03:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexFrazer/bfcd76f3bb652b7ffcbc to your computer and use it in GitHub Desktop.
Save AlexFrazer/bfcd76f3bb652b7ffcbc to your computer and use it in GitHub Desktop.
public void stateChanged(ChangeEvent e) {
21 if(finalImage!=null) {
BufferedImage gridImage= finalImage;
int hd=h_divide.getValue()+1;
if(hd>0) {
int distanceBetweenLines= finalImage.getHeight() / hd;
JSlider source = (JSlider)e.getSource();
if(!source.getValueIsAdjusting()) {
if(e.getSource()==h_divide) {
for(int i=0; i<finalImage.getHeight(); i+=distanceBetweenLines) {
for(int j=0; j<finalImage.getWidth(); j++) {
gridImage.setRGB(j,i,myColor.getRGB());
ImageIcon imgIcon2 = new ImageIcon();
imgIcon2.setImage(gridImage);
img.setIcon(imgIcon2);
img.invalidate();
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment