Java by API/org.eclipse.swt.widgets/DirectoryDialog — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
Admin (обсуждение | вклад) м (1 версия) |
(нет различий)
|
Текущая версия на 14:16, 31 мая 2010
Содержание
DirectoryDialog: open()
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class MainClass {
public static void main(String[] a) {
Display display = new Display();
final Shell shell = new Shell(display);
DirectoryDialog dlg = new DirectoryDialog(shell);
dlg.setFilterPath("c:/");
dlg.setText("SWT"s DirectoryDialog");
dlg.setMessage("Select a directory");
String dir = dlg.open();
if (dir != null) {
System.out.println(dir);
}
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
}
DirectoryDialog: setFilterPath(String path)
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class MainClass {
public static void main(String[] a) {
Display display = new Display();
final Shell shell = new Shell(display);
DirectoryDialog dlg = new DirectoryDialog(shell);
dlg.setFilterPath("c:/");
dlg.setText("SWT"s DirectoryDialog");
dlg.setMessage("Select a directory");
String dir = dlg.open();
if (dir != null) {
System.out.println(dir);
}
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
}
DirectoryDialog: setMessage(String message)
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class MainClass {
public static void main(String[] a) {
Display display = new Display();
final Shell shell = new Shell(display);
DirectoryDialog dlg = new DirectoryDialog(shell);
dlg.setFilterPath("c:/");
dlg.setText("SWT"s DirectoryDialog");
dlg.setMessage("Select a directory");
String dir = dlg.open();
if (dir != null) {
System.out.println(dir);
}
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
}
new DirectoryDialog(Shell shell)
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class MainClass {
public static void main(String[] a) {
Display display = new Display();
final Shell shell = new Shell(display);
DirectoryDialog dlg = new DirectoryDialog(shell);
dlg.setFilterPath("c:/");
dlg.setText("SWT"s DirectoryDialog");
dlg.setMessage("Select a directory");
String dir = dlg.open();
if (dir != null) {
System.out.println(dir);
}
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
}