我正在尝试显示来自网络的图像和 JLabel
中的文本,仅显示图像。
jlabel.setText("Hello" + "http://");
最佳答案
尝试:
URL url = new URL("http://www.url.com/image.jpg");
Image image = ImageIO.read(url);
jlabel.setIcon(new ImageIcon(image));
jlabel.setText("the text");
关于java - 如何在 jlabel 中显示来自网络的文本和图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27336547/