Like when we install any software we see a box where terms and condition is written. we scroll it till end and then accept or move forward. how can i achieve this in swing java. This is my code
package GUI;
import javax.swing.;
import java.awt.;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
public class Activation_screen {
JPanel activation_screen = new JPanel();
String path = "src/Assets/termsAndCondition";
public Activation_screen() {
activation_screen.setPreferredSize(new Dimension(900, 650));
activation_screen.setLayout(new BorderLayout());
activation_screen.setBackground(Color.gray);
JLabel title = new JLabel("Activate Windows");
title.setFont(new Font("Segoe UI", Font.BOLD, 30));
title.setForeground(Color.white);
title.setBorder(BorderFactory.createEmptyBorder(20, 0, 20, 0));
title.setHorizontalAlignment(SwingConstants.CENTER);
activation_screen.add(title, BorderLayout.NORTH);
}
private String readTermsAndConditions(String path) {
try {
Path path1 = Paths.get(path);
return Files.readString(path1);
} catch (IOException e) {
return "Error reading file.";
}
}
public Component getActivation() {
return activation_screen;
}
}