本文整理匯總了Java中edu.stanford.nlp.io.ui.OpenPageDialog類的典型用法代碼示例。如果您正苦於以下問題:Java OpenPageDialog類的具體用法?Java OpenPageDialog怎麽用?Java OpenPageDialog使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
OpenPageDialog類屬於edu.stanford.nlp.io.ui包,在下文中一共展示了OpenPageDialog類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: ParserPanel
import edu.stanford.nlp.io.ui.OpenPageDialog; //導入依賴的package包/類
/**
* Creates new form ParserPanel
*/
public ParserPanel() {
initComponents();
// create dialogs for file selection
jfc = new JFileChooser();
pageDialog = new OpenPageDialog(new Frame(), true);
pageDialog.setFileChooser(jfc);
setLanguage(UNTOKENIZED_ENGLISH);
// create a timer
timer = new javax.swing.Timer(ONE_SECOND, new TimerListener());
// for (un)highlighting text
highlightStyle = new SimpleAttributeSet();
normalStyle = new SimpleAttributeSet();
StyleConstants.setBackground(highlightStyle, Color.yellow);
StyleConstants.setBackground(normalStyle, textPane.getBackground());
}
示例2: ParserPanel
import edu.stanford.nlp.io.ui.OpenPageDialog; //導入依賴的package包/類
/**
* Creates new form ParserPanel
*/
public ParserPanel() {
initComponents();
// create dialogs for file selection
jfc = new JFileChooser(System.getProperty("user.dir"));
pageDialog = new OpenPageDialog(new Frame(), true);
pageDialog.setFileChooser(jfc);
jfcLocation = new JFileChooserLocation(jfc);
setLanguage(UNTOKENIZED_ENGLISH);
// create a timer
timer = new javax.swing.Timer(ONE_SECOND, new TimerListener());
// for (un)highlighting text
highlightStyle = new SimpleAttributeSet();
normalStyle = new SimpleAttributeSet();
StyleConstants.setBackground(highlightStyle, Color.yellow);
StyleConstants.setBackground(normalStyle, textPane.getBackground());
this.chooseJarParser = new JarFileChooser(".*\\.ser\\.gz", this);
}
示例3: loadFile
import edu.stanford.nlp.io.ui.OpenPageDialog; //導入依賴的package包/類
/**
* Opens dialog to load a text data file
*/
public void loadFile() {
// centers dialog in panel
pageDialog.setLocation(getLocationOnScreen().x + (getWidth() - pageDialog.getWidth()) / 2, getLocationOnScreen().y + (getHeight() - pageDialog.getHeight()) / 2);
pageDialog.setVisible(true);
if (pageDialog.getStatus() == OpenPageDialog.APPROVE_OPTION) {
loadFile(pageDialog.getPage());
}
}