我正在處理一個包含按鈕的JFrame /面板。當用戶點擊按鈕時,我想要一個圖像(它將被存儲在電腦硬盤中)在前屏幕上打開。如何使用Java打開.bmp/.jpeg圖像
button.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
//here i want a code that will somehow open the image from a given directory
}});
有關如何去解決這個問題的任何建議?我必須告訴圖像的存儲位置,並觸發虛擬「雙擊」,以使圖像在前屏幕上彈出。甚至有可能使用java來同步這些計算機功能?
這似乎是你在之後http://stackoverflow.com/questions/526037/java-how-to-open-user-system-preffered-editor-for-given-file – Karl 2010-12-02 22:53:23