I am currently engaged in Java learning as a computer science. As part of this assignment, I am trying to create an additional frame that the user can write UML code to which my main application will then be transferred, and then to the class diagram.
The bit that I'm stuck with is that the JTextBox that I injected into this secondary frame is the size I want, but the recording starts in the middle and does not change to a new line when it becomes a different frame size.
This is an image of what is currently happening:
![Image of output]! [The output of my current code](https://fooobar.com//img/286f5c523f44cc1a3738f556de980540.png)
the code
And this is the code that I have for this class, if needed.
package classdesign; import java.awt.*; import javax.swing.*; public class ClassCreation extends JFrame { private JFrame frame; private JLabel instructionlabel; private JTextField inputUML; private JButton upButton; private String Message; public void ClassCreation(){ frame = new JFrame(); frame.setSize(300, 400); frame.setLocationRelativeTo(null); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setTitle("Class Design"); JPanel CreationPanel = new JPanel(); CreationPanel.setLayout(new BorderLayout()); instructionlabel = new JLabel("Fill Class details in using UML"); CreationPanel.add(instructionlabel,BorderLayout.NORTH); inputUML = new JTextField("",20); CreationPanel.add(inputUML,BorderLayout.CENTER); frame.add(CreationPanel); } public Frame getFrame() { return frame; } }
So, to summarize what I was hoping, someone can tell me how to do this is to get the text from the user, to start in the upper left corner and go to the next line when he gets to the far right, text editor etc.
Danmc source share