Draw Line in a JLabel and add as JPanel in a JFrame does not function
问题 im very new in Java so sorry for any stupid question. Here is my problem: I just want to draw a line - if I add the JLabel Myline() directly as label to the JFrame MyFrame , then it will be showing in the resulting JFrame -Dialogwindow, but if I add MyLine() to the JPanel panel and panel to MyFrame then there is no Line. Why? package examples; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.Graphics; import java.awt.GridBagLayout; import java.awt