Skip to content
Snippets Groups Projects
Commit 37515aed authored by Ludovic Apvrille's avatar Ludovic Apvrille
Browse files

Enhancing dialog window for avatar signals

parent 87443dee
No related branches found
No related tags found
No related merge requests found
......@@ -117,13 +117,13 @@ public class JDialogAvatarSignal extends JDialogBase implements ActionListener
private void initComponents() {
Container c = getContentPane();
GridBagLayout gridbag0 = new GridBagLayout();
//GridBagLayout gridbag0 = new GridBagLayout();
GridBagLayout gridbag1 = new GridBagLayout();
GridBagConstraints c0 = new GridBagConstraints();
//GridBagConstraints c0 = new GridBagConstraints();
GridBagConstraints c1 = new GridBagConstraints();
setFont(new Font("Helvetica", Font.PLAIN, 14));
c.setLayout(gridbag0);
c.setLayout(new BorderLayout());
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
......@@ -132,7 +132,7 @@ public class JDialogAvatarSignal extends JDialogBase implements ActionListener
panel1.setBorder(new javax.swing.border.TitledBorder("Signals"));
panel1.setPreferredSize(new Dimension(500, 250));
//panel1.setPreferredSize(new Dimension(500, 250));
// first line panel1
c1.weighty = 1.0;
......@@ -183,22 +183,22 @@ public class JDialogAvatarSignal extends JDialogBase implements ActionListener
// main panel;
c0.gridwidth = 1;
/*c0.gridwidth = 1;
c0.gridheight = 10;
c0.weighty = 1.0;
c0.weightx = 1.0;
c0.gridwidth = GridBagConstraints.REMAINDER; //end row
c0.gridwidth = GridBagConstraints.REMAINDER; //end row*/
c.add(panel1, c0);
c.add(panel1, BorderLayout.CENTER);
c0.gridwidth = 1;
c0.gridheight = 1;
c0.fill = GridBagConstraints.HORIZONTAL;
//c0.gridwidth = 1;
//c0.gridheight = 1;
//c0.fill = GridBagConstraints.HORIZONTAL;
initButtons(c0, c, this);
initButtons(c, this);
}
public void actionPerformed(ActionEvent evt) {
......
package ui.window;
import java.awt.Container;
import java.awt.Dialog;
import java.awt.Frame;
import java.awt.GridBagConstraints;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.AbstractAction;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.KeyStroke;
import javax.swing.*;
import ui.util.IconManager;
......@@ -68,4 +61,30 @@ public class JDialogBase extends JDialog {
//Add closeButton's behaviour on Enter key
this.getRootPane().setDefaultButton(closeButton);
}
protected void initButtons(Container c,
ActionListener al) {
JPanel p = new JPanel(new FlowLayout());
//Close Button
closeButton = new JButton("Save and Close", IconManager.imgic25);
closeButton.addActionListener(al);
p.add(closeButton);
//Cancel Button
cancelButton = new JButton("Cancel", IconManager.imgic27);
cancelButton.addActionListener(al);
p.add(cancelButton);
c.add(p, BorderLayout.SOUTH);
//Add closeButton's behaviour on Enter key
this.getRootPane().setDefaultButton(closeButton);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment