About 162,000 results
Open links in new tab
  1. String (Java Platform SE 8 ) - Oracle Help Center

    The class String includes methods for examining individual characters of the sequence, for comparing strings, for searching strings, for extracting substrings, and for creating a copy of a string with all characters translated to uppercase or to lowercase.

  2. labeled statements - How to use labels in java? - Stack Overflow

    Java does not have a goto statement. A label marks the statement that follows it. You can use it to break out of that statement, and only out of that statement.

  3. Label (Java Platform SE 8 ) - Oracle

    Constructs a new label that presents the specified string of text with the specified alignment. Possible values for alignment are Label.LEFT, Label.RIGHT, and Label.CENTER.

  4. Java convert String to JLabel - Stack Overflow

    May 2, 2017 · Just create a JLabel in the app. and call label.setString(string)! Either that or construct the label using the String as argument, like new JLabel(string) @AndrewThompson - i could do this, but i would also like to load the color, border, position, size, …

  5. JLabel | Java Swing - GeeksforGeeks

    Apr 15, 2021 · JLabel is used to display a short string or an image icon. JLabel can display text, image or both . JLabel is only a display of text or image and it cannot get focus . JLabel is inactive to input events such a mouse focus or keyboard focus. By default labels are vertically centered but the user can change the alignment of label.

  6. java - How to format a text in JLabel - Stack Overflow

    Jul 18, 2012 · String.format() is used to insert content into a specially formatted string, not to display the string differently. JLabels and other Swing components do allow HTML however, which may get you what you need.

  7. Java AWT Label - GeeksforGeeks

    Sep 19, 2023 · A Label is an object of type Label (class in java.awt.Component), and it contains a string, which it displays within a container. Labels are passive controls that do not support any interaction with the user.

  8. Java Labels - Delft Stack

    Mar 11, 2025 · This tutorial demonstrates how to work with labels in Java, providing an insightful exploration of their usage in loops and switch statements. Learn the basics, see practical examples, and understand how labels can enhance the readability and control flow of your code.

  9. Labeled Breaks in Java: Useful Tool or Code Smell? - Baeldung

    Mar 14, 2025 · A poorly named label (e.g., x: instead of outer:) exacerbates this. Additionally, maintenance becomes harder; modifying a labeled loop risks breaking its dependencies, especially in large codebases. Refactoring, like extracting into methods or applying functional programming style by using Java’s Stream API, often is clearer:

  10. String (Java SE 11 & JDK 11 ) - Oracle

    The class String includes methods for examining individual characters of the sequence, for comparing strings, for searching strings, for extracting substrings, and for creating a copy of a string with all characters translated to uppercase or to lowercase.

  11. Some results have been removed
Refresh