Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Java
  4. JTextArea

JTextArea

Scheduled Pinned Locked Moved Java
java
2 Posts 2 Posters 6 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MallardsReach
    wrote on last edited by
    #1

    OK, so I'm back to using notepad++ in a panel I have a TextBox, Label and Buton all of which show but I have a TextArea that doesn't show, tried various ways but nothing has worked.

    private static void placeComponents(JPanel panel) 
    {
    		panel.setLayout(null);
    		JTextArea displayTable = new JTextArea("Text Area");
    		displayTable.setEditable(false);
    		displayTable.setColumns(20);
    		displayTable.setFont(new Font("Times New Roman", 1, 14));
    		displayTable.setLineWrap(true);
    		displayTable.setRows(14);
    		displayTable.setWrapStyleWord(true);
    		displayTable.setBorder(BorderFactory.createLineBorder(Color.GREEN));
    		displayTable.setMaximumSize(new java.awt.Dimension(5, 22));
    		panel.add(displayTable);
    
    L 1 Reply Last reply
    0
    • M MallardsReach

      OK, so I'm back to using notepad++ in a panel I have a TextBox, Label and Buton all of which show but I have a TextArea that doesn't show, tried various ways but nothing has worked.

      private static void placeComponents(JPanel panel) 
      {
      		panel.setLayout(null);
      		JTextArea displayTable = new JTextArea("Text Area");
      		displayTable.setEditable(false);
      		displayTable.setColumns(20);
      		displayTable.setFont(new Font("Times New Roman", 1, 14));
      		displayTable.setLineWrap(true);
      		displayTable.setRows(14);
      		displayTable.setWrapStyleWord(true);
      		displayTable.setBorder(BorderFactory.createLineBorder(Color.GREEN));
      		displayTable.setMaximumSize(new java.awt.Dimension(5, 22));
      		panel.add(displayTable);
      
      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Take a look at this example: Using Text Components (The Java™ Tutorials, Creating a GUI With JFC/Swing)[^]

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups