0

how to open the dialog?

asked 2015-01-24 07:40:36 +0800

jwasky gravatar image jwasky
11 3

i found error: method showopendialog in class javax.swing.jfilechooser cannot applied to given types; required: java.awt.component

how to get showopendialog in zkoss??? private void openFile() {

final JFileChooser fc = new JFileChooser();
fc.showOpenDialog(this);--------------------------->error 

try {
  txt_lht_file.setText("");
  namaFileExcel = fc.getSelectedFile();
  txt_lht_file.setText(namaFileExcel.toString());

} catch (Exception ioe) {
  System.out.println(ioe.toString());
}

}

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2015-01-24 08:37:06 +0800

chillworld gravatar image chillworld flag of Belgium
5337 4 9
https://github.com/chillw...

updated 2015-01-24 08:37:18 +0800

Swing isn't compatible with ZK.

I think you need a Fileupload and get()

Greetz chill.

link publish delete flag offensive edit
0

answered 2015-01-25 17:49:34 +0800

Darksu gravatar image Darksu
1991 1 4

Hello jwasky,

Please refer to the following url's in order to accomplish your task:

http://www.zkoss.org/zkdemo/filehandling/fileupload

http://zkfiddle.org/sample/2kopnr6/5-Multi-file-upload#source-1

Best Regards,

Darksu

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2015-01-24 07:40:36 +0800

Seen: 17 times

Last updated: Jan 25 '15

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More