Summary: This page describes the method to setuppageformat. |
Relevant major classes of Java SE: java.awt.*, java.awt.geom.*, java.awt.event.*, javax.swing.*, javax.swing.*
|
Classes on this page: DialogOfPageSetup, PageSetupAction |
1. Class DialogOfPageSetup
return=>page top
public class DialogOfPageSetup extends JDialog
Display the following dialog to setup the page (the sheet size and orientation).
Figure 1 PageSetup dialog
Field
|
Description
|
action
|
PageSetupAction action
The ActionListener object (PageSetupAction)
|
pageSizeSpinnerModel
|
SpinnerListModel pageSizeSpinnerModel
The spinner modes for setting the page size.
|
landscapeButton
|
JRadioButton landscapeButton
The button for setting the page orientation.
|
portraitButton
|
JRadioButton portraitButton
The button for setting the page orientation.
|
Method
|
Description
|
Constructor
|
public DialogOfPageSetup()
Sets the following.
super(ObjectTable.getDrawMain(), "Page Setup");
this.setName("DialogOfPageSetup");
this.action=new PageSetupAction(this);
this.addWindowListener(action);
|
showDialog
|
public DialogOfPageSetup showDialog()
∙ If the page setup dialog is already opened, this method does nothing.
Whether the dialog is opened or not canbe checked by the by the getMenuComponent of the menuUtil.
∙ Calls the createPagePanelmethod.
∙ Shows the dialog by calling this.setVisible(true).
∙ Registers this object to MenuComponentList by the setMenuComponent of the menuUtil.
|
createPagePanel
|
private JPanel createPagePanel()
Processing:
Creates the panel(Figure 1).
Sets the action to the "OK" and "Cancel" buttons.
|
2. Class PageSetupAction
return=>page top
|