Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Cannot read JTextArea it shows : cannot read "JTextArea Variable" because "this.SuperClass Variable" is null

user-aqfuwMay 25 2023
package key_master1;

import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.util.Arrays;
import javax.swing.JOptionPane;

public class Working{
    String paragraph = "Example";
    
    public Key_Master1 key;  //To Access Another Class Variable Create Variable for Superclass


public void addTextAreaListener() throws Exception{  //Create a Method 
    key.canvas.addKeyListener(new KeyListener(){
        @Override
        public void keyTyped(KeyEvent e) {
            //throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
            paragraph = e.toString();
            String[] words = paragraph.split(" ");
            for (String word : words){
                if(word.equalsIgnoreCase(word)){
                    JOptionPane.showMessageDialog(key.con,"In this Paragraph the word  \""+word+"\" is wrongly typed  so correct it before you type");
                }
            }
            
        }

        @Override
        public void keyPressed(KeyEvent e) {
            throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
        }

        @Override
        public void keyReleased(KeyEvent e) {
            throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
        }
        
    });
    
}

I Have Given my Working Code. I Will be grateful if someone helps me

Comments

Hiroshi Tonegawa May 31 2024

追加情報です。

リスナーからエラーメッセージでておりました。ただどうしたら良いのかわかりません。

そのlog(TNSLSNR.log)を添付しました。ここから原因、また対処法など解析できませんでしょうか?

大変困っております。よろしくお願いいたします。

TNSLSNR_496.log

1 - 1

Post Details

Added on May 25 2023
2 comments
327 views