Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
8ebaaaa
additional textarea/textpane work
Jan 6, 2019
ccd80a4
additional textpane/textarea work.
Jan 6, 2019
b1d6eb0
<pre> tag for JEditorPane
Jan 7, 2019
8fd715d
true KeyEvent,DefaultCaret implemented
Jan 8, 2019
973b5aa
resizer fix for adjustable resizability
Jan 9, 2019
4797dc2
j2sDoPropagate option for button and text UI
Jan 9, 2019
6ffc4a4
tooltip on hold during table editing
Jan 9, 2019
a55c07e
use of \u00A0 (no-break space) when calculating preferred size for label
Jan 9, 2019
b6c8989
better note directing to j2sClazz.js
Jan 9, 2019
e6940b8
fixes startProfiling() and getProfile()
Jan 9, 2019
b06495e
removes unnecessary Component.validateComponent() added earlier
Jan 9, 2019
96c9f82
adds key handling methods
Jan 9, 2019
aae03a6
more j2sNative issues - PrefixExpressions
Jan 9, 2019
3c93e5b
menu fixes for late-switching of JPopupMenu and JMenuBar menus
Jan 11, 2019
8572494
working on focus management
Jan 11, 2019
72d8e26
fixes height problem on JEditorPane UI after switching to HTML5
Jan 11, 2019
27a78e7
additional DOMNode interfaces options
Jan 11, 2019
da4ad9a
test files
Jan 11, 2019
776b663
focus
Jan 11, 2019
8d4c7c1
streamlining swingjs.allow.overflow client property option
Jan 11, 2019
c114cc0
fixes j2sClazz.js JSToolkit.getStackTrace() report
Jan 11, 2019
3790e0d
3.2.06 "b" update
Jan 11, 2019
368f622
menu mnemonics, MenuSelectionManager, KeyboardFocusManager, proper
Jan 14, 2019
7980de3
Exception.initCause(Throwable) typo in name
Jan 15, 2019
eef61d4
Exception.initCause(Throwable) typo in name
Jan 15, 2019
b097771
focus, events, menu accelerators and rewrite of ui-menu
Jan 17, 2019
5afffbd
corrected JSGraphics2D ctx translation 0.5,0.5 fix - line-drawing ONLY
Jan 18, 2019
7945ad4
focus and key events, menu accelerators and mnemonics, j2smenu work
Jan 18, 2019
801fa41
j2sMenu fix for menu closing prematurely
Jan 19, 2019
2b8bbd5
menu improvements -- now ui.j2smenu
Jan 20, 2019
fb9df5d
j2smenu
Jan 20, 2019
db0a9ea
jQuery.ui.j2smenu adaptation of jQuery.ui.menu
Jan 21, 2019
7f88d7e
Merge pull request #81 from BobHanson/hanson1
BobHanson Jan 21, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use of \u00A0 (no-break space) when calculating preferred size for label
also adds min width of 1px and height of current font
  • Loading branch information
hansonr authored and hansonr committed Jan 9, 2019
commit a55c07eb809e9ee963fdfcfaaa48eb2c19125ecb
12 changes: 10 additions & 2 deletions sources/net.sf.j2s.java.core/src/javax/swing/SwingUtilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -1019,10 +1019,18 @@ private static String layoutCompoundLabelImpl(
if (ui.textNode == null) {
textR.width = fm.stringWidth(text);
textR.height = fm.getHeight();
} else if (text.length() == 0) {
textR.width = 1;
textR.height = fm.getHeight();
} else {
String t = text.replace(' ', '\u00A0'); // no-break space
if (t != text)
DOMNode.setAttr(ui.textNode, "innerHTML", t);
Dimension d = ui.getHTMLSize(ui.textNode);
textR.width = d.width;
textR.height = d.height;
if (t != text)
DOMNode.setAttr(ui.textNode, "innerHTML", text);
textR.width = (d.width == 0 ? 1 : d.width);
textR.height = (d.height == 0 ? fm.getHeight() : d.height);
}
// Take into account the left and right side bearings.
// This gives more space than it is actually needed,
Expand Down