A quick application to show a simple JLabel : Label « Swing JFC « Java

Java
1. 2D Graphics GUI
2. 3D
3. Advanced Graphics
4. Ant
5. Apache Common
6. Chart
7. Class
8. Collections Data Structure
9. Data Type
10. Database SQL JDBC
11. Design Pattern
12. Development Class
13. EJB3
14. Email
15. Event
16. File Input Output
17. Game
18. Generics
19. GWT
20. Hibernate
21. I18N
22. J2EE
23. J2ME
24. JDK 6
25. JNDI LDAP
26. JPA
27. JSP
28. JSTL
29. Language Basics
30. Network Protocol
31. PDF RTF
32. Reflection
33. Regular Expressions
34. Scripting
35. Security
36. Servlets
37. Spring
38. Swing Components
39. Swing JFC
40. SWT JFace Eclipse
41. Threads
42. Tiny Application
43. Velocity
44. Web Services SOA
45. XML
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java » Swing JFC » LabelScreenshots 
A quick application to show a simple JLabel
A quick application to show a simple JLabel
 
//A quick application to show a simple JLabel.

import javax.swing.JFrame;
import javax.swing.JLabel;

public class SimpleJLabelExample {
  public static void main(String[] args) {
    JLabel label = new JLabel("A Very Simple Text Label");

    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().add(label);
    frame.pack();
    frame.setVisible(true);
  }
}

           
         
  
Related examples in the same category
1. Create a JLabel with an image icon
2. Create JLabel component
3. Create a JLabel component
4. Putting HTML text on Swing componentsPutting HTML text on Swing components
5. Shows how displayed Mnemonic and labelFor properties work togetherShows how displayed Mnemonic and labelFor properties work together
6. A JLabel that uses inline HTML to format its textA JLabel that uses inline HTML to format its text
7. Variations on a text and icon labelVariations on a text and icon label
8. A simple demonstration of text alignment in JLabelsA simple demonstration of text alignment in JLabels
9. Label with Image Label with Image
10. Label with HTML SampleLabel with HTML Sample
11. Label Text PositionLabel Text Position
12. LabelFor DemoLabelFor Demo
13. Label with IconLabel with Icon
14. Active Label SampleActive Label Sample
15. Swing Label DemoSwing Label Demo
16. Label alignmentLabel alignment
17. HTML labelHTML label
18. Label background, icon, alignLabel background, icon, align
19. Scrollable LabelScrollable Label
20. Grab and Drag image scroll labelGrab and Drag image scroll label
21. Animation label
22. Label with various effectsLabel with various effects
23. Label for Label for
24. LabelFocusSample: setLabelForLabelFocusSample: setLabelFor
25. Adding Drag-and-Drop Support to a JLabel Component
26. Setting the Focus of a JTextField Component Using a JLabel Component
27. Adding an Icon to a JLabel Component
28. The text is horizontally and vertically centered
29. The text is right-justified and vertically centered
30. The text is left-justified and top-aligned
31. The text is right-justified and top-aligned
32. The text is left-justified and bottom-aligned
33. The text is right-justified and bottom-aligned
34. JLabel with more than one row
35. JLabel is for displaying text, images or both. It does not react to input events.
36. JSlider lets the user graphically select a value by sliding a knob within a bounded interval.
37. JLabel with lined border
38. Label with ImageIcon (Icon)
39. Multiline label (HTML)
40. Disable a label
41. Set the Preferred Size
42. Horizontal Alignment: CENTER
43. Vertical Alignment: CENTER
44. Horizontal Alignment: LEFT
45. Vertical Alignment: TOP
46. Horizontal Alignment: RIGHT
47. Vertical Alignment: BOTTOM
48. Associate JLabel component with a JTextField
49. A Label that uses inline HTML to format its text
50. A label with no indication it has been clicked
51. Solve the problem of text alignment in JLabels
52. Use a ScrollBar in both vertical and horizontal direction
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.