项目:incubator-netbeans
文件:WindowBuilders.java
static ComponentBuilder getBuilder(Instance instance,Heap heap) {
if (DetailsUtils.isSubclassOf(instance,JRootPane.class.getName())) {
return new JRootPaneBuilder(instance,heap);
} else if (DetailsUtils.isSubclassOf(instance,JDesktopPane.class.getName())) {
return new JDesktopPaneBuilder(instance,JlayeredPane.class.getName())) {
return new JlayeredPaneBuilder(instance,Frame.class.getName())) {
return new FrameBuilder(instance,Dialog.class.getName())) {
return new DialogBuilder(instance,JInternalFrame.class.getName())) {
return new JInternalFrameBuilder(instance,heap);
}
return null;
}
/**
* Tab maximize.
*/
private void tabMaximize() {
// --- Maximize the main window ---------------------------------------
// Application.getMainWindow().setExtendedState(JFrame.MAXIMIZED_BOTH);
// --- Open a new JInteraFrame with the current tab enlarged ----------
SwingUtilities.invokelater(new Runnable() {
@Override
public void run() {
JDesktopPane appDesktop = Application.getMainWindow().getJDesktopPane4Projects();
if (maxTab == null) {
appDesktop.add(getMaximizedTab());
Application.getMainWindow().addJToolbarComponent(getMaximizedTab().getJButtonRestore4MainToolBar());
}
DesktopManager dtm = Application.getMainWindow().getJDesktopPane4Projects().getDesktopManager();
if (dtm != null) {
dtm.activateFrame(getMaximizedTab());
dtm.maximizeframe(getMaximizedTab());
}
}
});
}
public InternalFrameDemo() {
super("InternalFrameDemo");
// Make the big window be indented 50 pixels from each edge
// of the screen.
int inset = 50;
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
setBounds(inset,inset,screenSize.width - inset * 2,screenSize.height - inset * 2);
// Set up the GUI.
desktop = new JDesktopPane(); // a specialized layered pane
createFrame(); // create first "window"
setContentPane(desktop);
setJMenuBar(createMenuBar());
// Make dragging a little faster but perhaps uglier.
desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
}
项目:VASSAL-src
文件:GenericListener.java
/**
* Return true if the given component is likely to be a container such the each
* component within the container should be be considered as a user input.
*
* @param c
* @return true if the component children should have this listener added.
*/
protected boolean isProbablyAContainer (Component c) {
boolean result = extListener != null ? extListener.isContainer(c) : false;
if (!result) {
boolean isSwing = isSwingClass(c);
if (isSwing) {
result = c instanceof JPanel || c instanceof JSplitPane || c instanceof
JToolBar || c instanceof JViewport || c instanceof JScrollPane ||
c instanceof JFrame || c instanceof JRootPane || c instanceof
Window || c instanceof Frame || c instanceof Dialog ||
c instanceof JTabbedPane || c instanceof JInternalFrame ||
c instanceof JDesktopPane || c instanceof JlayeredPane;
} else {
result = c instanceof Container;
}
}
return result;
}
项目:Java-Air-Reservation
文件:Payment.java
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FirsT:event_jButton1ActionPerformed
String pattern1 = "[A-z\\s]*";
String fname = jTextField6.getText();
String Box1 = jTextField1.getText();
String Box2 = jTextField2.getText();
String Box3 = jTextField3.getText();
String Box4 = jTextField4.getText();
String Box5 = jTextField5.getText();
Integer Box7 = Integer.parseInt(jTextField7.getText());
Integer Box8 = Integer.parseInt(jTextField8.getText());
if((fname.matches(pattern1))&&(Box1.length()==4)&&(Box2.length()==4)&&(Box3.length()==4)&&(Box4.length()==4)&&(Box5.length()==3)&&(Box7<12)&&(Box8>17)) {
JOptionPane.showMessageDialog(rootPane,"payment detils wrong");
JDesktopPane desktopPane = getDesktopPane();
Customerlogin cl =new Customerlogin(cus.getpass_no());
desktopPane.add(cl);
cl.setVisible(true);
this.dispose();
}
// Todo add your handling code here:
}
项目:Java-Air-Reservation
文件:ChooseSeat.java
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FirsT:event_jButton1ActionPerformed
JDesktopPane desktopPane = getDesktopPane();
int class_ = Integer.parseInt(jComboBox2.getSelectedItem().toString());
LegClasses lc = new LegClasses(fl.getLeg_no(),class_);
if (!lc.isExist()) {
JOptionPane.showMessageDialog(rootPane,"Error: Selected Flight doesnt have that class type");
} else {
float amount = lc.getPrice();
Tickets tk = new Tickets();
tk.setLeg_no(fl.getLeg_no());
tk.setClass_(class_);
tk.setPass_no(cus.getpass_no());
tk.setSeat_no(Integer.parseInt(jComboBox1.getSelectedItem().toString()));
if (!tk.save()) {
JOptionPane.showMessageDialog(rootPane,"Error: Could not reserve ticket");
} else {
Payment p = new Payment(cus.getpass_no(),amount);
desktopPane.add(p);
p.setVisible(true);
this.dispose();
}
}
}
项目:Java-Air-Reservation
文件:Login.java
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FirsT:event_jButton3ActionPerformed
JDesktopPane desktopPane = getDesktopPane();
String user = jTextField3.getText();
String pass = new String(jpasswordfield2.getpassword());
Admin a = new Admin();
if (a.adminLogin(user,pass)) {
Adminlogin al = new Adminlogin();
desktopPane.add(al);
al.setVisible(true);
this.dispose();
} else {
JOptionPane.showMessageDialog(rootPane,"Error: Username or password incorrect");
}
}
项目:powertext
文件:Highlights.java
public static void highlightNext(String findText) {
int sel = jTabbedPane1.getSelectedindex();
JTextPane textPane = (JTextPane) ((JScrollPane) ((JDesktopPane)jTabbedPane1.getComponentAt(sel)).getComponent(0)).getViewport().getComponent(0);
if (findText.isEmpty())
return;
String context = textPane.getText();
String wordToFind = findText;
pos = context.indexOf(wordToFind,currentPos);
if (pos == -1)
currentPos = 0;
pos = context.indexOf(wordToFind,currentPos);
currentPos = pos;
if (pos != -1) {
textPane.setSelectionStart(pos);
textPane.setSelectionEnd(pos + wordToFind.length());
textPane.requestFocusInWindow();
currentPos = (currentPos + 1);
} else {
currentPos = 0;
}
}
项目:powertext
文件:findreplace.java
public static void findNext() {
int sel = jTabbedPane1.getSelectedindex();
JTextPane textPane = (JTextPane) ((JScrollPane) ((JDesktopPane)jTabbedPane1.getComponentAt(sel)).getComponent(0)).getViewport().getComponent(0);
if (findword.getText().isEmpty())
return;
String context = textPane.getText();
String wordToFind = findword.getText();
pos = context.indexOf(wordToFind,currentPos);
currentPos = pos;
if (pos != -1) {
textPane.setSelectionStart(pos);
textPane.setSelectionEnd(pos + wordToFind.length());
textPane.requestFocusInWindow();
currentPos = (currentPos + 1);
} else {
currentPos = 0;
notfound.setVisible(true);
}
}
public Test6505027(JFrame main) {
Container container = main;
if (INTERNAL) {
JInternalFrame frame = new JInternalFrame();
frame.setBounds(OFFSET,OFFSET,WIDTH,HEIGHT);
frame.setVisible(true);
JDesktopPane desktop = new JDesktopPane();
desktop.add(frame,new Integer(1));
container.add(desktop);
container = frame;
}
if (TERMINATE) {
this.table.putClientProperty(KEY,Boolean.TRUE);
}
TableColumn column = this.table.getColumn(COLUMNS[1]);
column.setCellEditor(new DefaultCellEditor(new JComboBox(ITEMS)));
container.add(BorderLayout.norTH,new JTextField());
container.add(BorderLayout.CENTER,new JScrollPane(this.table));
}
项目:openjdk-jdk10
文件:DesktopPaneBackgroundTest.java
public static void main(String[] args) throws Exception {
defaultBackgroudColor = (Color) Toolkit.getDefaultToolkit()
.getDesktopProperty("win.mdi.backgroundColor");
String[] lookAndFeel = new String[]{
"com.sun.java.swing.plaf.windows.WindowsLookAndFeel","com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel"};
for (String laf : lookAndFeel) {
UIManager.setLookAndFeel(laf);
SwingUtilities.invokeAndWait(() -> {
JDesktopPane desktopPane = new JDesktopPane();
Color background = desktopPane.getBackground();
if (!background.equals(defaultBackgroudColor)) {
throw new RuntimeException("Invalid JDesktopPane "
+ "Background Color for WLAF");
}
});
}
}
项目:openjdk-jdk10
文件:DockIconRepaint.java
private static void createUI() {
frame = new JFrame();
frame.setUndecorated(true);
frame.setSize(300,300);
frame.setLocationRelativeto(null);
final JDesktopPane pane = new JDesktopPane();
final JPanel panel = new JPanel() {
@Override
protected void paintComponent(Graphics g) {
g.setColor(color);
g.fillRect(0,getWidth(),getHeight());
}
};
jif = new JInternalFrame();
jif.add(panel);
jif.setVisible(true);
jif.setSize(300,300);
pane.add(jif);
frame.add(pane);
frame.setVisible(true);
}
public Test6505027(JFrame main) {
Container container = main;
if (INTERNAL) {
JInternalFrame frame = new JInternalFrame();
frame.setBounds(OFFSET,new JScrollPane(this.table));
}
项目:openjdk-jdk10
文件:JInternalFrameDraggingTest.java
private static void createAndShowGUI() {
frame = new JFrame();
frame.setDefaultCloSEOperation(JFrame.EXIT_ON_CLOSE);
frame.setLayout(new BorderLayout());
desktopPane = new JDesktopPane();
desktopPane.setBackground(BACKGROUND_COLOR);
frame.add(desktopPane,BorderLayout.CENTER);
frame.setSize(FRAME_SIZE,FRAME_SIZE);
frame.setVisible(true);
internalFrame = new JInternalFrame("Test");
internalFrame.setSize(FRAME_SIZE / 2,FRAME_SIZE / 2);
desktopPane.add(internalFrame);
internalFrame.setVisible(true);
internalFrame.setResizable(true);
frame.setVisible(true);
}
private static void createUI(String lookAndFeelString) {
internalFrame = new JInternalFrame("Internal",true,true);
internalFrame.setDefaultCloSEOperation(
WindowConstants.DO_nothing_ON_CLOSE);
internalFrame.setSize(200,200);
JDesktopPane desktopPane = new JDesktopPane();
desktopPane.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
desktopPane.add(internalFrame);
mainFrame = new JFrame(lookAndFeelString);
mainFrame.setSize(640,480);
mainFrame.setDefaultCloSEOperation(JFrame.EXIT_ON_CLOSE);
mainFrame.setContentPane(desktopPane);
mainFrame.setVisible(true);
internalFrame.setVisible(true);
}
项目:openjdk9
文件:DesktopPaneBackgroundTest.java
public static void main(String[] args) throws Exception {
defaultBackgroudColor = (Color) Toolkit.getDefaultToolkit()
.getDesktopProperty("win.mdi.backgroundColor");
String[] lookAndFeel = new String[]{
"com.sun.java.swing.plaf.windows.WindowsLookAndFeel","com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel"};
for (String laf : lookAndFeel) {
UIManager.setLookAndFeel(laf);
SwingUtilities.invokeAndWait(() -> {
JDesktopPane desktopPane = new JDesktopPane();
Color background = desktopPane.getBackground();
if (!background.equals(defaultBackgroudColor)) {
throw new RuntimeException("Invalid JDesktopPane "
+ "Background Color for WLAF");
}
});
}
}
项目:openjdk9
文件:DockIconRepaint.java
private static void createUI() {
frame = new JFrame();
frame.setUndecorated(true);
frame.setSize(300,300);
pane.add(jif);
frame.add(pane);
frame.setVisible(true);
}
public Test6505027(JFrame main) {
Container container = main;
if (INTERNAL) {
JInternalFrame frame = new JInternalFrame();
frame.setBounds(OFFSET,new JScrollPane(this.table));
}
private static void createUI(String lookAndFeelString) {
internalFrame = new JInternalFrame("Internal",480);
mainFrame.setDefaultCloSEOperation(JFrame.EXIT_ON_CLOSE);
mainFrame.setContentPane(desktopPane);
mainFrame.setVisible(true);
internalFrame.setVisible(true);
}
项目:fmj-sourceforge-mirror
文件:ViewingPanel.java
/**
* Create a panel in which a JDesktopPane is used to
* to display screens for viewing a Player.
*
* @param title
* Title displayed in border of JDesktopPane
*/
public ViewingPanel(String title) {
TitledBorder tb;
setLayout(new BorderLayout());
desktop = new JDesktopPane();
desktop.setLayout(new TileLayout());
desktop.setBorder(tb = new TitledBorder(
new CompoundBorder(
new EtchedBorder(),new EmptyBorder(4,4,4)),title));
tb.setTitleColor(Color.black);
desktop.setopaque(false);
desktop.setBackground(UIManager.getColor("control"));
add(desktop,BorderLayout.CENTER);
hash = new Hashtable();
}
项目:ProjectGoldStarsX
文件:Window.java
private void buildWindow()
{
JFrame frame = new JFrame("Project GoldStars X");
frame.setDefaultCloSEOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(1100 * ProjectGoldStarsX.multiplier,575 * ProjectGoldStarsX.multiplier);
frame.setExtendedState(frame.MAXIMIZED_BOTH);
frame.setLayout(new BorderLayout());
frame.setUndecorated(true);
frame.setIconImage(getimage());
frame.getContentPane().setBackground(ProjectGoldStarsX.color1);
frame.setJMenuBar(menuBar());
ProjectGoldStarsX.desktop = new JDesktopPane();
background();
frame.add(ProjectGoldStarsX.desktop);
frame.setVisible(true);
}
项目:CanReg5
文件:ModifyDatabaseStructureInternalFrame.java
/** Creates new form ModifyDatabaseStructureInternalFrame */
public ModifyDatabaseStructureInternalFrame(JDesktopPane dtp) {
initComponents();
this.dtp = dtp;
regionComboBox.setModel(new DefaultComboBoxModel(new String[]{
Globals.REGIONS[1],Globals.REGIONS[2],Globals.REGIONS[3],Globals.REGIONS[4],Globals.REGIONS[5],Globals.REGIONS[6],Globals.REGIONS[9]
}));
setListeners();
// searchVariablesPanel.setEnabled(true);
// databaseIndexPanel.setVisible(false);
codingPanel.setVisible(false);
settingsPanel.setVisible(false);
}
项目:CanReg5
文件:ComparePatientsInternalFrame.java
/** Creates new form ComparePatientsInternalFrame */
public ComparePatientsInternalFrame(JDesktopPane desktopPane) {
this.desktopPane = desktopPane;
initComponents();
firstColumnName = "Merge";
firstColumnName = "-----";
globalToolBox = canreg.client.CanRegClientApp.getApplication().getGlobalToolBox();
patientIDlookupVariable = globalToolBox.translateStandardVariableNametoDatabaseListElement(Globals.StandardVariableNames.PatientID.toString()).getDatabaseVariableName();
tumourIDlookupVariable = globalToolBox.translateStandardVariableNametoDatabaseListElement(Globals.StandardVariableNames.TumourID.toString()).getDatabaseVariableName();
patientIDTumourTablelookupVariable = globalToolBox.translateStandardVariableNametoDatabaseListElement(Globals.StandardVariableNames.PatientIDTumourTable.toString()).getDatabaseVariableName();
Document doc = globalToolBox.getDocument();
PersonSearchVariable[] searchVariables = Tools.getPersonSearchVariables(doc,Globals.NAMESPACE);
LinkedList<String> defaultColumnsList = new LinkedList<String>();
// defaultColumnsList.add(patientIDlookupVariable);
for (PersonSearchVariable psv : searchVariables) {
defaultColumnsList.add(psv.getName());
}
defaultColumns = defaultColumnsList.toArray(new String[0]);
recordSets = new LinkedList<Pair<Patient,Tumour[]>>();
percentList = new LinkedList<Float>();
mergeButton.setVisible(false);
localSettings = CanRegClientApp.getApplication().getLocalSettings();
}
项目:CanReg5
文件:FrequenciesByYearInternalFrame.java
/**
* Creates new form FrequenciesByYearInternalFrame
*
* @param dtp
*/
public FrequenciesByYearInternalFrame(JDesktopPane dtp) {
this.dtp = dtp;
dictionary = CanRegClientApp.getApplication().getDictionary();
initComponents();
initOtherComponents();
localSettings = CanRegClientApp.getApplication().getLocalSettings();
addInternalFrameListener(new InternalFrameAdapter() {
@Override
public void internalFrameClosing(InternalFrameEvent e) {
close();
}
});
}
/**
* Creates new form browseInternalFrame
*
* @param dtp
*/
public browseInternalFrame(JDesktopPane dtp) {
this.dtp = dtp;
globalToolBox = CanRegClientApp.getApplication().getGlobalToolBox();
patientIDlookupVariable = globalToolBox.translateStandardVariableNametoDatabaseListElement(Globals.StandardVariableNames.PatientID.toString()).getDatabaseVariableName();
patientIDTumourTablelookupVariable = globalToolBox.translateStandardVariableNametoDatabaseListElement(Globals.StandardVariableNames.PatientIDTumourTable.toString()).getDatabaseVariableName();
patientRecordIDTumourTablelookupVariable = globalToolBox.translateStandardVariableNametoDatabaseListElement(Globals.StandardVariableNames.PatientRecordIDTumourTable.toString()).getDatabaseVariableName();
patientRecordIDVariable = globalToolBox.translateStandardVariableNametoDatabaseListElement(Globals.StandardVariableNames.PatientRecordID.toString()).getDatabaseVariableName();
tumourIDlookupVariable = globalToolBox.translateStandardVariableNametoDatabaseListElement(Globals.StandardVariableNames.TumourID.toString()).getDatabaseVariableName();
tumourIDSourceTableLookupVariable = globalToolBox.translateStandardVariableNametoDatabaseListElement(Globals.StandardVariableNames.TumourIDSourceTable.toString()).getDatabaseVariableName();
patientIDLength = globalToolBox.translateStandardVariableNametoDatabaseListElement(Globals.StandardVariableNames.PatientID.toString()).getvariableLength();
tumourIDLength = globalToolBox.translateStandardVariableNametoDatabaseListElement(Globals.StandardVariableNames.TumourID.toString()).getvariableLength();
localSettings = CanRegClientApp.getApplication().getLocalSettings();
initComponents();
initOtherComponents();
initValues();
pack();
}
项目:semtool
文件:SelectDatabasePanel.java
private void enabledisableOverlay() {
Insight ii = questionSelector.getItemAt( questionSelector.getSelectedindex() );
if ( null == ii ) {
appendChkBox.setEnabled( false );
}
else {
//Determine whether to enable/disable the "Overlay" CheckBox,based upon
//how the renderer of the selected visualization compares with that of the
//currently selected question:
JDesktopPane pane = DIHelper.getInstance().getDesktop();
OutputTypeRegistry registry = DIHelper.getInstance().getoutputTypeRegistry();
PlaySheetFrame psf = PlaySheetFrame.class.cast( pane.getSelectedFrame() );
PlaySheetCentralComponent pscc = ( null == psf ? null
: psf.getActivePlaySheet() );
Class<? extends IPlaySheet> psccclass
= ( null == pscc ? null : pscc.getClass() );
final InsightOutputType type = ii.getoutput();
appendChkBox.setEnabled( null == type
? false : type.equals( registry.getTypeFromClass( psccclass ) ) );
}
if ( !appendChkBox.isEnabled() ) {
appendChkBox.setSelected( false );
}
}
项目:cmanager
文件:CacheListController.java
public static void storePersistanceInfo(JDesktopPane desktop) throws IOException
{
CacheListController top = getTopViewCacheController(desktop);
ArrayList<PersistenceInfo> pi = new ArrayList<>();
for (CacheListController clc : controllerList)
{
if (clc == top)
continue;
pi.add(clc.getPersistenceO());
}
if (top != null)
pi.add(top.getPersistenceO());
Settings.setSerialized(Settings.Key.CLC_LIST,pi);
}
项目:geoxygene
文件:FloatingMainFrame.java
/**
* Add a new frame into the main frame.
*
* @param project project frame to add
*/
void addProjectFrame(final JDesktopPane desktop,final ProjectFrame project) {
if (project instanceof FloatingProjectFrame) {
try {
FloatingProjectFrame floatingProject = (FloatingProjectFrame) project;
logger.debug("N°" + desktop.getAllFrames().length);
desktop.add(floatingProject.getInternalFrame());
floatingProject.getInternalFrame().setVisible(true);
floatingProject.getInternalFrame().setSelected(true);
desktop.setSelectedFrame(floatingProject.getInternalFrame());
} catch (Exception e) {
e.printstacktrace();
logger.error("not allowed to set floatingProject visible and selected");
}
} else {
logger.error("Cannot add a " + project.getClass().getSimpleName()
+ " into a " + this.getClass().getSimpleName());
}
}
项目:geoxygene
文件:FloatingMainFrame.java
/**
* Get all frames of the CURRENT desktop
*/
@Override
public final ProjectFrame[] getDesktopProjectFrames() {
List<ProjectFrame> projectFrameList = new ArrayList<ProjectFrame>();
JDesktopPane currentDesktop = this.getCurrentDesktop();
if (currentDesktop == null) {
return new ProjectFrame[0];
}
for (JInternalFrame frameGui : currentDesktop.getAllFrames()) {
ProjectFrame projectFrame = this.getProjectFrameFromGui(frameGui);
if (projectFrame != null) {
projectFrameList.add(projectFrame);
}
}
return projectFrameList.toArray(new ProjectFrame[0]);
}
项目:geoxygene
文件:FloatingMainFrame.java
public void organizeCurrentDesktop(int ncol) {
JDesktopPane currentDesktop = this.getCurrentDesktop();
if (currentDesktop == null) {
return;
}
ProjectFrame[] projectFrames = this.getDesktopProjectFrames();
currentDesktop.removeAll();
GridLayout layout = new GridLayout(0,ncol);
currentDesktop.setLayout(layout);
for (ProjectFrame project : projectFrames) {
currentDesktop.add(project.getGui());
}
currentDesktop.doLayout();
currentDesktop.setLayout(null); // Now set layout to free moves
}
public Test6505027(JFrame main) {
Container container = main;
if (INTERNAL) {
JInternalFrame frame = new JInternalFrame();
frame.setBounds(OFFSET,new JScrollPane(this.table));
}
项目:jdk8u_jdk
文件:JInternalFrameDraggingTest.java
private static void createAndShowGUI() {
frame = new JFrame();
frame.setDefaultCloSEOperation(JFrame.EXIT_ON_CLOSE);
frame.setLayout(new BorderLayout());
desktopPane = new JDesktopPane();
desktopPane.setBackground(BACKGROUND_COLOR);
frame.add(desktopPane,FRAME_SIZE / 2);
desktopPane.add(internalFrame);
internalFrame.setVisible(true);
internalFrame.setResizable(true);
frame.setVisible(true);
}
public Test6505027(JFrame main) {
Container container = main;
if (INTERNAL) {
JInternalFrame frame = new JInternalFrame();
frame.setBounds(OFFSET,new JScrollPane(this.table));
}
项目:AgentWorkbench
文件:SimulationManagerAgent.java
@SuppressWarnings("unchecked")
protected void setup() {
// ----- get the arguments/coordinates of gol.acl.agents --------------------------------
agentArgs = this.getArguments();
cRow = (Integer) agentArgs[0];
cCol = (Integer) agentArgs[1];
localEnvModel = (HashMap<String,Integer>) agentArgs[2];
// ---------- start and show GUI ------------------------------------------------
gui = new GameOfLifeGUI(cRow,cCol,this);
gui.bClear.setEnabled(false);
gui.bPause.setEnabled(false);
gui.bStart.setEnabled(false);
gui.setResizable(true);
gui.setMaximizable(true);
JDesktopPane desptop = Application.getProjectFocused().getProjectDesktop();
desptop.add(gui);
desptop.getDesktopManager().maximizeframe(gui);
doWait(3000);
// --- Start cyclic behavIoUr for this Manager Agent ----------------------------
this.addBehavIoUr(new StepBehavIoUr());
this.addBehavIoUr(new ReceiveBehavIoUr());
gui.bClear.setEnabled(true);
gui.bPause.setEnabled(false);
gui.bStart.setEnabled(true);
}
项目:AgentWorkbench
文件:UiBridge.java
/**
* Gets the progress monitor.
*
* @param windowTitle the window title
* @param headerText the header text
* @param progresstext the progress text
* @return the progress monitor
*/
public AwbProgressMonitor getProgressMonitor(String windowTitle,String headerText,String progresstext) {
AwbProgressMonitor progressMonitor = null;
switch (this.getVisualisationPlatform()) {
case EclipseFramework:
// --- SWT progress visualization dialog ----------------
//Todo
System.err.println("SWT Progress Monitor not implemented yet!");
break;
case AgentGuiSwing:
// --- Swing progress visualization dialog --------------------
// --- Try to get a JDesktopPane ----------------------------
JDesktopPane desktop = null;
if (Application.getMainWindow() != null) {
desktop = Application.getMainWindow().getJDesktopPane4Projects();
}
// --- Get the image icon for the progress monitor ----------
ImageIcon imageIcon = GlobalInfo.getInternalImageIcon("AgentGUI.png");
// --- Get the look and feel --------------------------------
String lookAndFeelClassName = Application.getGlobalInfo().getAppLookAndFeelClassName();
progressMonitor = new org.agentgui.gui.swing.dialogs.ProgressMonitor(windowTitle,headerText,progresstext,imageIcon,desktop,lookAndFeelClassName);
break;
}
return progressMonitor;
}
项目:LivroJavaComoProgramar10Edicao
文件:DesktopFrame.java
public DesktopFrame()
{
super("Using a JDesktopPane");
JMenuBar bar = new JMenuBar();
JMenu addMenu = new JMenu("Add");
JMenuItem newFrame = new JMenuItem("Internal Frame");
addMenu.add(newFrame); // add new frame item to Add menu
bar.add(addMenu); // add Add menu to menu bar
setJMenuBar(bar); // set menu bar for this application
theDesktop = new JDesktopPane();
add(theDesktop); // add desktop pane to frame
// set up listener for newFrame menu item
newFrame.addActionListener(
new ActionListener() // anonymous inner class
{
// display new internal window
@Override
public void actionPerformed(ActionEvent event)
{
// create internal frame
JInternalFrame frame = new JInternalFrame(
"Internal Frame",true);
MyJPanel panel = new MyJPanel();
frame.add(panel,BorderLayout.CENTER);
frame.pack(); // set internal frame to size of contents
theDesktop.add(frame); // attach internal frame
frame.setVisible(true); // show internal frame
}
}
);
}
项目:Java-Air-Reservation
文件:Payment.java
项目:Java-Air-Reservation
文件:Adminlogin.java
项目:Java-Air-Reservation
文件:Adminlogin.java
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FirsT:event_jButton1ActionPerformed
// Todo add your handling code here:
JDesktopPane desktopPane = getDesktopPane();
ManageAirport mngair =new ManageAirport();
desktopPane.add(mngair);
mngair.setVisible(true);
this.dispose();
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。