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
32d70ad1
Commit
32d70ad1
authored
5 years ago
by
Le Van Truong
Browse files
Options
Downloads
Patches
Plain Diff
fix NullPointerException when task selected at the begining
parent
fcf77481
No related branches found
No related tags found
1 merge request
!305
fix NullPointerException when task selected at the begining
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/ui/interactivesimulation/JPanelTaskTransactions.java
+14
-6
14 additions, 6 deletions
...java/ui/interactivesimulation/JPanelTaskTransactions.java
with
14 additions
and
6 deletions
src/main/java/ui/interactivesimulation/JPanelTaskTransactions.java
+
14
−
6
View file @
32d70ad1
...
...
@@ -6,6 +6,8 @@ import ui.TGComponent;
import
javax.swing.*
;
import
java.awt.*
;
import
java.awt.event.ActionEvent
;
import
java.awt.event.ActionListener
;
import
java.awt.event.ItemEvent
;
import
java.awt.event.ItemListener
;
import
java.util.Vector
;
...
...
@@ -83,8 +85,9 @@ public class JPanelTaskTransactions extends JPanel {
nbOfTransactions
=
new
JTextField
(
Integer
.
toString
(
defaultNbOfTransactions
),
defaultNbOfTransactions
);
add
(
nbOfTransactions
,
c2
);
add
(
new
JLabel
(
" "
),
c2
);
add
(
new
JLabel
(
"
# Task Name:
"
),
c2
);
tasks
=
new
JComboBox
<>();
tasks
.
addItem
(
"-----"
);
if
(
tmlm
!=
null
){
for
(
int
k
=
0
;
k
<
tmlm
.
getTasks
().
size
();
k
++){
tasks
.
addItem
(
tmlm
.
getTasks
().
get
(
k
).
getName
());
...
...
@@ -93,12 +96,17 @@ public class JPanelTaskTransactions extends JPanel {
tasks
.
setSelectedIndex
(
0
);
add
(
tasks
,
c2
);
//
updateTransactionInformationButton = new JButton(jfis.actions[InteractiveSimulationActions.ACT_UPDATE_TRANSACTIONS]);
//
add(updateTransactionInformationButton, c2);
tasks
.
add
Item
Listener
(
new
Item
Listener
()
{
updateTransactionInformationButton
=
new
JButton
(
jfis
.
actions
[
InteractiveSimulationActions
.
ACT_UPDATE_TRANSACTIONS
]);
add
(
updateTransactionInformationButton
,
c2
);
tasks
.
add
Action
Listener
(
new
Action
Listener
()
{
@Override
public
void
itemStateChanged
(
ItemEvent
e
)
{
if
(
e
.
getStateChange
()
==
ItemEvent
.
SELECTED
)
{
public
void
actionPerformed
(
ActionEvent
actionEvent
)
{
if
(
_trans
==
null
){
System
.
out
.
println
(
"TRANSACTION LIST IS NULL \nYOU NEED TO UPDATE TRANSACTIONS FIRST"
);
final
JPopupMenu
menu
=
new
JPopupMenu
(
"Alert"
);
menu
.
add
(
"TRANSACTION LIST IS NULL. \nYOU NEED TO UPDATE TRANSACTIONS FIRST."
);
menu
.
show
(
updateTransactionInformationButton
,
updateTransactionInformationButton
.
getWidth
()/
2
,
updateTransactionInformationButton
.
getHeight
()/
2
);
}
else
{
System
.
out
.
println
(
tasks
.
getSelectedItem
().
toString
());
if
(
ttm
!=
null
)
{
ttm
.
setData
(
_trans
,
tasks
.
getSelectedItem
().
toString
());
...
...
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