将 MP4 文件添加到 JPanel 并对其进行缩放 - Java
Add MP4-File to JPanel and scale it - Java
我在 JFrame
中有一个 JPanel
:
import javax.swing.JFrame;
import javax.swing.JPanel;
public class Demo{
public static void main(String [] args) {
JFrame frame = new JFrame() {
private static final long serialVersionUID = 1L;
{
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(200, 200);
setLocationRelativeTo(null);
add(new JPanel() {
private static final long serialVersionUID = 1L;
{
//Here I want to add the video!
}
});
}
};
frame.setVisible(true);
}
}
是否可以...
添加视频到 JPanel
缩放视频(您可以用 Images
这样做:getScaledInstance(width, height, Image.SCALE_SMOOTH)
)?
播放视频
我在 JFrame
中有一个 JPanel
:
import javax.swing.JFrame;
import javax.swing.JPanel;
public class Demo{
public static void main(String [] args) {
JFrame frame = new JFrame() {
private static final long serialVersionUID = 1L;
{
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(200, 200);
setLocationRelativeTo(null);
add(new JPanel() {
private static final long serialVersionUID = 1L;
{
//Here I want to add the video!
}
});
}
};
frame.setVisible(true);
}
}
是否可以...
添加视频到
JPanel
缩放视频(您可以用
Images
这样做:getScaledInstance(width, height, Image.SCALE_SMOOTH)
)?播放视频