Java JTextComponent readOnly(JTextComponent c, Component parent)

Here you can find the source of readOnly(JTextComponent c, Component parent)

Description

read Only

License

Open Source License

Declaration

public static void readOnly(JTextComponent c, Component parent) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.awt.*;

import javax.swing.text.*;

public class Main {
    public static void readOnly(JTextComponent c, Component parent) {
        c.setEditable(false);/*w  ww . java2s  .  c  om*/
        c.setForeground(parent.getForeground());
        c.setBackground(parent.getBackground());
    }
}

Related

  1. makeVisible(JTextComponent textPane, int start, int end)
  2. maxLength(JTextComponent textComponent, int length)
  3. paintCurrentLineBackground(final Graphics g, final JTextComponent c, final Color col)
  4. paintUnderline(Graphics g, JTextComponent tc, int pos0, int pos1)
  5. parseDouble(JTextComponent textComponent)
  6. refreshJTextComponent(JTextComponent textComponent)
  7. registerEvents(final JTextComponent textCmp, final String hintText)
  8. registerUpperCase(final JTextComponent textComp)
  9. removeAllHighlightsUsingPainter(final JTextComponent textComponent, final Highlighter.HighlightPainter painter)