()
| 36 | // Figures out how wide each line of the label |
| 37 | // is, and how wide the widest line is. |
| 38 | protected void measure() { |
| 39 | Font font = getFont(); |
| 40 | FontMetrics fm = font!=null?getFontMetrics(font):null; |
| 41 | // If we don't have font metrics yet, just return. |
| 42 | if (fm == null) return; |
| 43 | line_height = fm.getHeight(); |
| 44 | line_ascent = fm.getAscent(); |
| 45 | max_width = 0; |
| 46 | for(int i = 0; i < num_lines; i++) { |
| 47 | line_widths[i] = fm.stringWidth(lines[i]); |
| 48 | if (line_widths[i] > max_width) max_width = line_widths[i]; |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | |
| 53 | public void setText(String text) { |
no test coverage detected