I have this for my jtextarea i try a lot of things to align it on center or right but it's always outside the windows
This is the result I have for now :
With this code :
Popup noticePopup = new Popup("Notice" , 1500, 900);
JPanel noticePanel = new JPanel();
noticePanel.setPreferredSize(new Dimension(1500,1000));
List<List> ListNote = controller.Medicament.consultationNotice(idMedoc);
String noticeThis =null;
for(int n=0;n<ListNote.size();n++) {
noticeThis = (String) ListNote.get(n).get(1);
}
JTextArea noticeArea = new JTextArea(noticeThis);
noticePopup.add(noticePanel);
noticePanel.add(noticeArea);
noticeArea.setAlignmentX(JTextArea.CENTER_ALIGNMENT);
Thank you