diff --git a/cs623/proj1/RetirementCalculator.java b/cs623/proj1/RetirementCalculator.java index de7bfe1..1e0f588 100644 --- a/cs623/proj1/RetirementCalculator.java +++ b/cs623/proj1/RetirementCalculator.java @@ -152,7 +152,7 @@ class RetirementCalculatorPanel field = new JTextField(); field.addFocusListener(this); myFields.put("employer pension", field); - myToolTips.put(field, "If your employer has a pension plan that will pay you a certain amount after you retire from them, then enter that amount here."); + myToolTips.put(field, "If your employer has a pension plan that will pay you a certain amount
after you retire from them, then enter that amount here."); addDollarRow(inner, new JLabel(" - from an employer pension plan?", SwingConstants.RIGHT), @@ -169,7 +169,7 @@ class RetirementCalculatorPanel field = new JTextField(); field.addFocusListener(this); myFields.put("other income", field); - myToolTips.put(field, "If there is any other annual income you expect to receive after retirement not already accounted for, enter the amount here."); + myToolTips.put(field, "If there is any other annual income you expect to receive after retirement
not already accounted for, enter the amount here."); addDollarRow(inner, new JLabel(" - other?", SwingConstants.RIGHT), field); addRow(inner, makeDivider()); @@ -219,22 +219,23 @@ class RetirementCalculatorPanel buttons.add(myResetButton); buttons.add(Box.createHorizontalGlue()); - addRow(inner, makeDivider()); - addRow(inner, myToolTipBox); +// addRow(inner, makeDivider()); + addRow(inner, buttons); - addRow(inner, makeDivider()); - - myResultBox = new JLabel(" ", SwingConstants.CENTER); - addRow(inner, myResultBox); +// addRow(inner, makeDivider()); JScrollPane scrollpane = new JScrollPane(inner, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); add(scrollpane); + myResultBox = new JLabel(" ", SwingConstants.CENTER); + myResultBox.setForeground(new Color(0, 0, 200)); + add(myResultBox, BorderLayout.SOUTH); + reset(); } @@ -257,7 +258,11 @@ class RetirementCalculatorPanel String tooltip = myToolTips.get(e.getComponent()); if (tooltip != null) { - myToolTipBox.setText(tooltip); + if (tooltip.indexOf("   "; + } + myToolTipBox.setText("" + tooltip + ""); } }