Eu to tentando fazer a imagem do me Jlabel ter zoom, já tentei de várias formas e ate peguei codigos deste msm site
segue os código que tenho:
//imageLabelMouseWheelMoved
private static BufferedImage resize(BufferedImage image, int width, int height) {
BufferedImage resizedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = resizedImage.createGraphics();
g.drawImage(image, 0, 0, width, height, null);
g.dispose();
return resizedImage;
//usando um botão:
private void showImageZoomIn(URL imageURL, BufferedImage image) {
int zoomwidth = image.getWidth() * 2;
int zoomheight = image.getHeight() * 2;
Image img = new ImageIcon(image).getImage().getScaledInstance(zoomwidth, zoomheight, Image.SCALE_DEFAULT);
imageLabel.setText(null);
imageLabel.setIcon(new ImageIcon(img));
imageLabel.repaint();
imageLabel.validate();
AMBOS DÃO ERRO NO PRIVATE STATIC… COMO ILLEGAL START OF EXPRESSION
ME AJUDEM!