public static Form getForm(this javax.swing.JFrame frame) { // retreive the WinForm from a java frame var peer = frame.getPeer(); return((Form)peer.GetType().GetProperty("Control", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(peer, null)); }
/// <summary> Creates a window, embeds the visualiser in it /// and shows that window. /// </summary> public virtual void show() { JFrame frame = new JFrame(getCaption(System.DateTime.Now)); //UPGRADE_ISSUE: Field 'java.awt.BorderLayout.CENTER' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"' frame.ContentPane.add(VisualiserPanel, BorderLayout.CENTER); frame.pack(); frame.setVisible(true); frame.setSize(700, 500); this.setMyFrame(frame); }
public static void wrap(Form owner, javax.swing.JFrame frame) { // fetch the required gui elements var panelOuter = (javax.swing.JPanel)frame.getContentPane().getComponent(0); var panelInner = (javax.swing.JPanel)panelOuter.getComponent(0); var userNameInput = (javax.swing.JTextField)panelInner.getComponent(2); var passwordInput = (javax.swing.JPasswordField)panelInner.getComponent(4); var okButton = (javax.swing.JButton)panelInner.getComponent(7); // update the dialog title and input boxes frame.setTitle("Consens-Anmeldung"); userNameInput.setText(Credentials.UserName); passwordInput.setText(Credentials.Password); // create a checkbox for specifying whether to persist the credentials var saveCredentialsInput = new javax.swing.JCheckBox("Kennwort speichern", Credentials.Save); var c = new java.awt.GridBagConstraints(); c.fill = java.awt.GridBagConstraints.HORIZONTAL; c.gridx = 4; c.gridy = 4; panelInner.add(saveCredentialsInput, c); frame.validate(); // hook the required events var dialog = new LogonDialog(userNameInput, passwordInput, saveCredentialsInput); passwordInput.addPropertyChangeListener("enabled", dialog); okButton.addActionListener(dialog); // turn the WinForm into a dialog var form = frame.getForm(); form.BeginInvoke(new MethodInvoker(() => { form.Owner = owner; form.MinimizeBox = false; form.MaximizeBox = false; form.ShowInTaskbar = false; form.FormBorderStyle = FormBorderStyle.FixedDialog; form.Focus(); })); }
public static bool match(javax.swing.JFrame frame) { // test if the given frame is the logon dialog return(frame.getTitle().StartsWith("ZeitConsens Webinterface")); }
public abstract void loadExtension(javax.swing.JFrame paramJFrame, Properties paramProperties);