0

カードベースのアプリケーションを作成しようとしています。私はチュートリアルなどに従おうとしています。これが私のコードです。ここまでは非常に単純です。ウィンドウは表示されますが、内部のテキストペインは表示されません。

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package professorphysinstall;

/**
*
* @author Kyle
*/

//Imports
  import java.awt.CardLayout;
  import javax.swing.JFrame;
  import javax.swing.JPanel;
  import javax.swing.JTextPane;

  public class ProfessorPhysInstall {

/**
 * @param args the command line arguments
 */
public static void main(String[] args) {
    // TODO code application logic here
    //Variables
    JFrame mainframe = new JFrame();
    mainframe.setSize(500, 435);
    JPanel cards = new JPanel(new CardLayout());
    CardLayout cl = (CardLayout)(cards.getLayout());
    mainframe.setTitle("Future Retro Gaming Launcher");
    //Screen1
    JPanel screen1 = new JPanel();
    JTextPane TextPaneScreen1 = new JTextPane();
    TextPaneScreen1.setEditable(false);
    TextPaneScreen1.setBackground(new java.awt.Color(240, 240, 240));
    TextPaneScreen1.setText("Welcome to the install wizard  for Professor Phys!\n\nPlease agree to the following terms and click the next button to continue.");
    TextPaneScreen1.setSize(358, 48);
    TextPaneScreen1.setLocation(0, 0);
    screen1.add(TextPaneScreen1);
    mainframe.add(cards);
    mainframe.setVisible(true);
}
}
4

1 に答える 1