Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nils Vreman
ScheduLearn
Commits
c43ae92c
Commit
c43ae92c
authored
Aug 21, 2018
by
Nils Vreman
Browse files
Fixed problem with text disappearing when list option pressed
parent
91a440f6
Changes
3
Hide whitespace changes
Inline
Side-by-side
gui/menu/help/HelpMenuPane.java
View file @
c43ae92c
...
...
@@ -18,7 +18,7 @@ public class HelpMenuPane extends JFrame {
tabbedPane
.
addTab
(
"Schedule"
,
new
ScheduleTab
());
tabbedPane
.
setTabLayoutPolicy
(
JTabbedPane
.
SCROLL_TAB_LAYOUT
);
tabbedPane
.
setPreferredSize
(
new
Dimension
(
4
00
,
400
));
tabbedPane
.
setPreferredSize
(
new
Dimension
(
5
00
,
400
));
add
(
CENTER
,
tabbedPane
);
...
...
gui/menu/help/ScheduleTab.java
View file @
c43ae92c
...
...
@@ -5,16 +5,17 @@ public class ScheduleTab extends TabPanel {
private
static
final
String
[]
listOptions
=
new
String
[]
{
"Schedule"
,
"Solution"
,
"Checking Solution"
,
"Clearing Cells"
,
"Clearing Strategy"
};
"Check Solution"
,
"Clear Cells"
,
"Clear Strategy"
};
private
static
final
String
[]
helpTexts
=
new
String
[]
{
"Schedule"
,
"Solution"
,
"Check
ing
Solution"
,
"Clear
ing
Cells"
,
"Clear
ing
Strategy"
};
"Check Solution"
,
"Clear Cells"
,
"Clear Strategy"
};
public
ScheduleTab
()
{
super
(
listOptions
,
helpTexts
);
...
...
gui/menu/help/TabPanel.java
View file @
c43ae92c
...
...
@@ -3,20 +3,23 @@ package gui.menu.help;
import
javax.swing.JPanel
;
import
javax.swing.JTextField
;
import
java.awt.BorderLayout
;
import
java.awt.Dimension
;
import
java.util.Map
;
import
java.util.HashMap
;
public
abstract
class
TabPanel
extends
JPanel
implements
EventListener
{
private
final
String
[]
listOptions
;
private
OptionList
list
;
private
Map
<
String
,
JTextField
>
helpTexts
=
new
HashMap
<>();
public
TabPanel
(
String
[]
listOptions
,
String
[]
fieldTexts
)
{
super
(
new
BorderLayout
());
this
.
listOptions
=
listOptions
;
OptionList
list
=
new
OptionList
(
listOptions
);
list
=
new
OptionList
(
listOptions
);
list
.
addListener
(
this
);
list
.
setPreferredSize
(
new
Dimension
(
120
,
400
));
for
(
int
i
=
0
;
i
<
listOptions
.
length
;
i
++)
{
JTextField
htf
=
new
HelpTextField
(
fieldTexts
[
i
]);
...
...
@@ -28,10 +31,14 @@ public abstract class TabPanel extends JPanel implements EventListener {
}
public
void
update
(
String
tab
)
{
removeAll
();
add
(
BorderLayout
.
WEST
,
list
);
if
(
helpTexts
.
containsKey
(
tab
))
{
add
(
BorderLayout
.
CENTER
,
helpTexts
.
get
(
tab
));
revalidate
();
repaint
();
}
revalidate
();
repaint
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment