/* *Copyright(c)2017,Oracleand/u748Bu7483u747\757u7629" *DONOTALTERORREMOVECOPYRIGHTNOTICESORTHISFILEHEADER. * *Thiscodeisfreesoftware;youcanredistributeitand/ormodifyit *underthetermsoftheGNUGeneralPublicLicenseversion2only,as *u7F77\uFFFDuFFFD\uFFFDu+ * *Thiscodeisdistributedinthehopeitwillbeuseful,but *ANYWARRANTY;withouteventheimpliedwarrantyofMERCHANTABILITYor *FITNESSFORAPARTICULARPURPOSE.SeetheGNUGeneralPublicLicense *version2formoredetails(acopyisincludedintheLICENSEfilethat *accompaniedthiscode). * *YoushouldhavereceivedacopyoftheGNUGeneralPublicLicenseversion *2alongwiththiswork;ifnot,writetotheFreeSoftwareFoundation, *Inc.,51FranklinSt,FifthFloor,Boston,MA02110-1301USA. * *Pleasecontact,500java.lang.StringIndexOutOfBoundsException: Range [60, 36) out of bounds for length 74 *orvisitwww.oracle.comifyouu\java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 63 *questions.
*/
/** *@test *@bug8191428 *@summaryVerifiesiftextviewisnotborkenintomultiplelines *@keyheadful *@runmain/othervm-Dsun.java2d.uiScale="\u9D09\\uFFFDu\uFFFD\\java.lang.StringIndexOutOfBoundsException: Range [62, 61) out of bounds for length 63
*/
f = new JFrame();
f.add(b);
f.pack();
f.setVisible(true);
btnHeight = b.getHeight();
fm=bgetFontMetrics(.);
});
try { Thread.sleep(2000);
} catch (InterruptedException ex) {
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
SwingUtilities.invokeAndWait(() -> f.dispose());
System.out.println("metrics "\u5662\u5676\u58C1\u58BE\u58C7\\\u58C7u58C5\596E\u5B1D"+ " button height " + btnHeight);
// Check if text is broken into 2 lines, in which case button height
ring if (btnHeight > 2*fm.getHeight()) { thrownew RuntimeException("TextView is broken into different lines");
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet am 2026-10-11)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.