0

does anyone know how to remove those 3 dots from java components? my problem : a java widget with a title border which, after resize, keeps adding those 3 dots.

I would want for it to display the truncated title which fits that given area. I managed to set its justification to the left but those 3 dots keep reappereaing...

or, at least, where, in java library, are those 3 points drawn? I searched through java libraries and couldn't fin it.

This happens using java 1.7

assylias
  • 321,522
  • 82
  • 660
  • 783
Bogdan T.
  • 668
  • 6
  • 13
  • Are you sure this is just Java and not windows fault? The solution is to rename your title as you resize so the title fits the window size. – Athiwat Chunlakhan Mar 28 '12 at 16:21
  • 1
    An ellipsis (i.e. `...`) usually indicates that the preferred width of the text is longer than that of its container. – mre Mar 28 '12 at 16:21
  • 1
    I assume you mean the [ellipsis](http://en.wikipedia.org/wiki/Ellipsis), right? – Thomas Mar 28 '12 at 16:22
  • Yeah, I don't know about the three dots at all, can you show us what you mean? – devsnd Mar 28 '12 at 16:23
  • by renaming the title, you mean go to my componentResized() and recall setTitle? – Bogdan T. Mar 28 '12 at 16:31
  • Closely related: [How to check how many characters will fit in a title in a `JFrame`?](https://stackoverflow.com/q/65595184/16673) – Suma Jan 06 '21 at 13:47

2 Answers2

1

You'd normally do that in the UI classes. Here's a similar question: Java JLabel/JButton: on some systems I get "..." (an ellipsis) and on some systems I don't. how can I force to disable the ellipsis at all?

Community
  • 1
  • 1
Thomas
  • 87,414
  • 12
  • 119
  • 157
0

It is not Java or Swing who display the three dots (the "ellipsis"), it is the underlying OS (Windows, Linux ...).

The Java just sets the native window title property.

Suma
  • 33,181
  • 16
  • 123
  • 191