java, get set methods

java, get set methods

This question has been asked before, but even after reading:

This question has been asked before, but even after reading:

Java "Get" and "Set" Methods

Java Get/Set method returns null

And more I still don't understand how to solve my problem.

When accessing variables in a class using get methods from another class I receive the value null.

How do I recieve my correct values instead of null?

This is the class where I try to get my variables FROM (not everything included).

public class RLS_character_panel extends javax.swing.JPanel implements ActionListener, ItemListener { 

private String name1 = "hello"; 

public String getName1() { 
    return name1; 
} 

public void setName1(String name1) { 
    this.name1 = name1; 
} 

}

This is the class where i try to get the values TO. This class extends JFrame so that I can add a JPanel which displays the variable. (the JPanel is yet another class called: RLS_strid_panel , which is added upon this frame).

public class RLS_strid_java extends JFrame { 

RLS_character_panel test = new RLS_character_panel(); 

String name1 = test.getName1(); 

RLS_strid_panel p = new RLS_strid_panel(namn1); 

// constructor
public RLS_strid_java(String titel) { 
    super(titel); 
    this.setSize(1000, 772); 
    this.setVisible(true); 
    this.setResizable(false); 
    this.add(p); 
} 

}

the Jpanel Displays null.

java

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Java Core (2020) | Java for beginners | Brush up your Java Skills | Get Hired

In this video we will learn about all the major concepts that come under Java Core . The course is very carefully designed and is made with keeping simplicit...

Java Fundamentals: Learn Java for absolute beginners |Simpliv

Java Fundamentals: Learn Java for absolute beginners

Java Essentials : Learn Core Java From Basic to Advance

Learn Java Programming Using Practical Assignments. Start Building Back-end Web Applications Robust Test Automation Frameworks By End Of The Course. Learn More!

How Java Became The Best Career Option for IT Jobs in 2020?

Join CETPA, India's best institute for Java online training and Certification Course. Enroll now to learn Core to Advanced Java & avail 50% discount on Java Online Course with Certificate.

Java Online Certifications Courses To Level Up Your Career In 2020

Join CETPA, India's best institute for Java online training and Certification Course. Enroll now to learn Core to Advanced Java & avail 50% discount on Java Online Course with Certificate.