All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.actelion.research.gui.swing.SwingTextField Maven / Gradle / Ivy

There is a newer version: 2024.11.2
Show newest version
package com.actelion.research.gui.swing;

import com.actelion.research.gui.generic.GenericTextField;

import javax.swing.*;
import javax.swing.text.JTextComponent;

public class SwingTextField extends SwingComponent implements GenericTextField {
	public SwingTextField(int width, int height) {
		super(height == 1 ? new JTextField(width/2) : new JTextArea(height, width));
	}

	public String getText() {
		return ((JTextComponent)getComponent()).getText();
	}

	public void setText(String text) {
		((JTextComponent)getComponent()).setText(text);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy