| |
17. 119. 1. 显示的界限,客户区 |
|
Device represents a physical device.
It's an abstract class, and has two concrete subclasses: Display and Printer. |
import org.eclipse.swt.graphics.Device;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class DeviceDisplayBoundary {
public static void main(String[] args) {
final Display display = new Display();
final Shell shell = new Shell(display);
Device device = shell.getDisplay();
System.out.println("getBounds(): "+ device.getBounds());
System.out.println("getClientArea(): " +device.getClientArea());
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
}
|
|
17. 119. 设备 | | 17. 119. 1. | 显示的界限,客户区 | | | | 17. 119. 2. | 显示的色彩深度 | | | | 17. 119. 3. | 它是否支持打印 | | |
|