メソッド .getText(); 機能しません。また、paramContext(); も機能しません。
基本的に、大量のテキストを入力する必要があり (TextField が十分に大きくないため、TextArea を使用しました)、その情報を文字列に格納する必要があります。だから私はそれを操作することができます。
タイプのテキストエリアのままにしておくことは可能ですか?それでもそこから単語やフレーズを抽出しますか?
コードは次のとおりです。
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.Scanner;
import java.io.*;
public class EmailExtractionGUI extends EasyApp
{
private TextArea emailInput = new TextArea("", 0,0, TextArea.SCROLLBARS_VERTICAL_ONLY);
public static void main(String[] args)
{
new EmailExtractionGUI();
}
//Left,Height position,width,height
Label passwordEntry = addLabel("Email Extraction Programme", 200,50,350,30,this);
//TextArea emailInput = addTextArea("",75,100,600,550,this);
Button bGo = addButton("Go",650,680,65,30,this);
Button bReset = addButton("Reset",575,680,65,30,this);
public EmailExtractionGUI()
{
setSize(750,750);
setTitle("Email Extraction");
setBackground(Color.white);
Font Andalus = new Font("Andalus", 3, 24);// 1st number here 1=bold, 2=italics,3=bold&italics, 0=norm
passwordEntry.setForeground(Color.blue);
passwordEntry.setFont(Andalus);
emailInput.setBackground(Color.white);
}
public void actions(Object source, String command)
{
if (source == bGo)
{
String emailText = emailInput.getText();
// Emails email = new Emails(emailText);
System.out.println(emailText);
}
前もって感謝します!