Label example in java

Содержание
  1. Label example in java
  2. Nested Class Summary
  3. Nested classes/interfaces declared in class java.awt.Component
  4. Field Summary
  5. Fields declared in class java.awt.Component
  6. Fields declared in interface java.awt.image.ImageObserver
  7. Constructor Summary
  8. Method Summary
  9. Methods declared in class java.awt.Component
  10. Methods declared in class java.lang.Object
  11. Field Detail
  12. LEFT
  13. CENTER
  14. RIGHT
  15. Constructor Detail
  16. Label
  17. Label
  18. Label
  19. Method Detail
  20. addNotify
  21. getAlignment
  22. setAlignment
  23. getText
  24. setText
  25. paramString
  26. getAccessibleContext
  27. Class Label
  28. Nested Class Summary
  29. Nested classes/interfaces declared in class java.awt.Component
  30. Field Summary
  31. Fields declared in class java.awt.Component
  32. Fields declared in interface java.awt.image.ImageObserver
  33. Constructor Summary
  34. Method Summary
  35. Methods declared in class java.awt.Component
  36. Methods declared in class java.lang.Object
  37. Field Details
  38. LEFT
  39. CENTER
  40. RIGHT
  41. Constructor Details
  42. Label
  43. Label
  44. Label
  45. Method Details
  46. addNotify
  47. getAlignment
  48. setAlignment
  49. getText
  50. setText
  51. paramString
  52. getAccessibleContext
  53. Class Label
  54. Nested Class Summary
  55. Nested classes/interfaces declared in class java.awt.Component
  56. Field Summary
  57. Fields declared in class java.awt.Component
  58. Fields declared in interface java.awt.image.ImageObserver
  59. Constructor Summary
  60. Method Summary
  61. Methods declared in class java.awt.Component
  62. Methods declared in class java.lang.Object
  63. Field Details
  64. LEFT
  65. CENTER
  66. RIGHT
  67. Constructor Details
  68. Label
  69. Label
  70. Label
  71. Method Details
  72. addNotify
  73. getAlignment
  74. setAlignment
  75. getText
  76. setText
  77. paramString
  78. getAccessibleContext
  79. Label example in java
  80. Learn Latest Tutorials
  81. Preparation
  82. Trending Technologies
  83. B.Tech / MCA
  84. Javatpoint Services
  85. Training For College Campus

Label example in java

A Label object is a component for placing text in a container. A label displays a single line of read-only text. The text can be changed by the application, but a user cannot edit it directly. For example, the code . . .

setLayout(new FlowLayout(FlowLayout.CENTER, 10, 10)); add(new Label("Hi There!")); add(new Label("Another Label"));

Nested Class Summary

Nested classes/interfaces declared in class java.awt.Component

Field Summary

Fields declared in class java.awt.Component

Fields declared in interface java.awt.image.ImageObserver

Constructor Summary

Method Summary

Methods declared in class java.awt.Component

Methods declared in class java.lang.Object

Field Detail

LEFT

public static final int LEFT

CENTER

public static final int CENTER
public static final int RIGHT

Constructor Detail

Label

Label

public Label​(String text) throws HeadlessException

Label

public Label​(String text, int alignment) throws HeadlessException

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 .

Читайте также:  Python приведение типов переменных

Method Detail

addNotify

Creates the peer for this label. The peer allows us to modify the appearance of the label without changing its functionality.

getAlignment

Gets the current alignment of this label. Possible values are Label.LEFT , Label.RIGHT , and Label.CENTER .

setAlignment

public void setAlignment​(int alignment)

Sets the alignment for this label to the specified alignment. Possible values are Label.LEFT , Label.RIGHT , and Label.CENTER .

getText

setText

paramString

Returns a string representing the state of this Label . This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null .

getAccessibleContext

Gets the AccessibleContext associated with this Label. For labels, the AccessibleContext takes the form of an AccessibleAWTLabel. A new AccessibleAWTLabel instance is created if necessary.

Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2023, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.

Источник

Class Label

A Label object is a component for placing text in a container. A label displays a single line of read-only text. The text can be changed by the application, but a user cannot edit it directly.

setLayout(new FlowLayout(FlowLayout.CENTER, 10, 10)); add(new Label("Hi There!")); add(new Label("Another Label"));

produces the following labels:

Nested Class Summary

Nested classes/interfaces declared in class java.awt.Component

Field Summary

Fields declared in class java.awt.Component

Fields declared in interface java.awt.image.ImageObserver

Constructor Summary

Method Summary

Methods declared in class java.awt.Component

Methods declared in class java.lang.Object

Field Details

LEFT

CENTER

RIGHT

Constructor Details

Label

Label

Label

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 .

Читайте также:  Русское Авто

Method Details

addNotify

Creates the peer for this label. The peer allows us to modify the appearance of the label without changing its functionality.

getAlignment

Gets the current alignment of this label. Possible values are Label.LEFT , Label.RIGHT , and Label.CENTER .

setAlignment

Sets the alignment for this label to the specified alignment. Possible values are Label.LEFT , Label.RIGHT , and Label.CENTER .

getText

setText

paramString

Returns a string representing the state of this Label . This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null .

getAccessibleContext

Gets the AccessibleContext associated with this Label. For labels, the AccessibleContext takes the form of an AccessibleAWTLabel. A new AccessibleAWTLabel instance is created if necessary.

Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples. Other versions.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2023, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.

Источник

Class Label

A Label object is a component for placing text in a container. A label displays a single line of read-only text. The text can be changed by the application, but a user cannot edit it directly.

setLayout(new FlowLayout(FlowLayout.CENTER, 10, 10)); add(new Label("Hi There!")); add(new Label("Another Label"));

produces the following labels:

Nested Class Summary

Nested classes/interfaces declared in class java.awt.Component

Field Summary

Fields declared in class java.awt.Component

Fields declared in interface java.awt.image.ImageObserver

Constructor Summary

Method Summary

Methods declared in class java.awt.Component

Methods declared in class java.lang.Object

Field Details

LEFT

CENTER

RIGHT

Constructor Details

Label

Label

Label

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 .

Читайте также:  Adding css class to javascript

Method Details

addNotify

Creates the peer for this label. The peer allows us to modify the appearance of the label without changing its functionality.

getAlignment

Gets the current alignment of this label. Possible values are Label.LEFT , Label.RIGHT , and Label.CENTER .

setAlignment

Sets the alignment for this label to the specified alignment. Possible values are Label.LEFT , Label.RIGHT , and Label.CENTER .

getText

setText

paramString

Returns a string representing the state of this Label . This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null .

getAccessibleContext

Gets the AccessibleContext associated with this Label. For labels, the AccessibleContext takes the form of an AccessibleAWTLabel. A new AccessibleAWTLabel instance is created if necessary.

Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples. Other versions.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2023, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.

Источник

Label example in java

Learn Latest Tutorials

Splunk tutorial

SPSS tutorial

Swagger tutorial

T-SQL tutorial

Tumblr tutorial

React tutorial

Regex tutorial

Reinforcement learning tutorial

R Programming tutorial

RxJS tutorial

React Native tutorial

Python Design Patterns

Python Pillow tutorial

Python Turtle tutorial

Keras tutorial

Preparation

Aptitude

Logical Reasoning

Verbal Ability

Company Interview Questions

Artificial Intelligence

AWS Tutorial

Selenium tutorial

Cloud Computing

Hadoop tutorial

ReactJS Tutorial

Data Science Tutorial

Angular 7 Tutorial

Blockchain Tutorial

Git Tutorial

Machine Learning Tutorial

DevOps Tutorial

B.Tech / MCA

DBMS tutorial

Data Structures tutorial

DAA tutorial

Operating System

Computer Network tutorial

Compiler Design tutorial

Computer Organization and Architecture

Discrete Mathematics Tutorial

Ethical Hacking

Computer Graphics Tutorial

Software Engineering

html tutorial

Cyber Security tutorial

Automata Tutorial

C Language tutorial

C++ tutorial

Java tutorial

.Net Framework tutorial

Python tutorial

List of Programs

Control Systems tutorial

Data Mining Tutorial

Data Warehouse Tutorial

Javatpoint Services

JavaTpoint offers too many high quality services. Mail us on h[email protected], to get more information about given services.

  • Website Designing
  • Website Development
  • Java Development
  • PHP Development
  • WordPress
  • Graphic Designing
  • Logo
  • Digital Marketing
  • On Page and Off Page SEO
  • PPC
  • Content Development
  • Corporate Training
  • Classroom and Online Training
  • Data Entry

Training For College Campus

JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected].
Duration: 1 week to 2 week

Like/Subscribe us for latest updates or newsletter RSS Feed Subscribe to Get Email Alerts Facebook Page Twitter Page YouTube Blog Page

Источник

Оцените статью