Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TTool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mbe-tools
TTool
Commits
37515aed
Commit
37515aed
authored
7 years ago
by
Ludovic Apvrille
Browse files
Options
Downloads
Patches
Plain Diff
Enhancing dialog window for avatar signals
parent
87443dee
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/ui/window/JDialogAvatarSignal.java
+11
-11
11 additions, 11 deletions
src/main/java/ui/window/JDialogAvatarSignal.java
src/main/java/ui/window/JDialogBase.java
+28
-9
28 additions, 9 deletions
src/main/java/ui/window/JDialogBase.java
with
39 additions
and
20 deletions
src/main/java/ui/window/JDialogAvatarSignal.java
+
11
−
11
View file @
37515aed
...
...
@@ -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
)
{
...
...
This diff is collapsed.
Click to expand it.
src/main/java/ui/window/JDialogBase.java
+
28
−
9
View file @
37515aed
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
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment