Advertisement
Guest User

Untitled

a guest
Dec 12th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. BufferedImage myPicture;
  2. try{
  3. myPicture = ImageIO.read(new File(txtImgPath.toString()));
  4. JLabel picLabel = new JLabel(new ImageIcon(myPicture));
  5. picLabel.setPreferredSize(dim);
  6. panCenter.add(picLabel);
  7. }
  8. catch(IOException e){
  9. System.out.println("Image IO exception while reading image");
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement