Answer the question
In order to leave comments, you need to log in
Java.Lang.NullPointerException, What should I do about this leprosy?
I tried to put the text in areatex
, then (of course, after the next zero), put the character in choose
, still zero. Help me please!
public class Main {
public static void main(String[] args) {
Lois kit = new Lois();
kit. areatex.setText(kit.fdfe);
kit.choose.setText(String.valueOf(kit.symb.length));
kit.frame.setSize(500,500);//тут подчеркивается kit и выдает variable kit might not have been initialized
kit.frame.setVisible(true);
kit.frame.add(kit.areatex , BorderLayout.NORTH);
kit.frame.add(kit.choose , BorderLayout.CENTER);
kit.frame.add(kit.areaa , BorderLayout.SOUTH);
kit.frame.add(kit.tellma , BorderLayout.EAST);
kit.areatex.setSize(10,1);
kit.choose.setSize(10,1);
kit.areaa.setSize(10,1);
kit.tellma.setSize(30,30);
kit.areaa.setText(kit.touser);
}
}
public class Lois {
Pitter husband;
JFrame frame = new JFrame();
int x = 0;
JTextArea areatex = new JTextArea();
JTextArea choose = new JTextArea();
JTextArea areaa = new JTextArea();
JButton tellma = new JButton();
String fdfe ="Не поверишь, но от этой надписи зависит работа программы." ;
String infoof = areatex.getText();
String touser = "Ваш символ встретился в данном вами предложении ровно " + husband.wife.x;
String abchos = choose.getText();
char[] choise = abchos.toCharArray();
String pw = "n";
char[] symb = pw.toCharArray();
}
public class Pitter {
Lois wife;
ActionListener WhatDo = new ActionListener() {
public void actionPerformed(ActionEvent e) {
wife.symb = wife.infoof.toCharArray();
for (int i = 0; i < wife.symb.length; i++) {
if (wife.symb[i] == wife.choise.length) {
wife.x = wife.x + 1;
}
}
}
};
}
String touser = "Ваш символ встретился в данном вами предложении ровно " + husband.wife.x;
Lois kit = new Lois();
Answer the question
In order to leave comments, you need to log in
String touser = "Your character was encountered in the sentence you provided exactly " + husband.wife.x;
husband == null
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question