//줄바꿈시 가운데 정렬 기능을 위해 JTextPane 사용 JTextPane tpName = new JTextPane(); tpName.setEditable(false); tpName.setText(goodsName); //tpName의 styleDocument를 가져와 가운데 정렬 설정 StyledDocument doc = tpName.getStyledDocument(); SimpleAttributeSet center = new SimpleAttributeSet(); StyleConstants.setAlignment(center, StyleConstants.ALIGN_CENTER); doc.setParagraphAttributes(0, doc.getLength(), center, false); add..
mport java.awt.EventQueue; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.table.DefaultTableModel; public class MyTable extends JFrame{ //MAIN METHOD public static void main(String[] args) { EventQueue.invok..