Questions tagged [cardlayout]

A CardLayout is a graphical layout manager for a container. It treats each component in the container as a card. Only one card is visible at a time, and the container acts as a stack of cards.

A CardLayout is a graphical layout manager for a Container. It treats each component in the container as a card. Only one card is visible at a time, and the container acts as a stack of cards.

For Java Swing, see How to Use CardLayout.

562 questions
-2
votes
3 answers

NullPointerException in a Java Swing application

I have a class that implements card layout: CardWindow.java import java.awt.CardLayout; import java.awt.EventQueue; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import…
sw2
  • 357
  • 6
  • 13
-2
votes
2 answers

Calling a JPanel in a JFrame of another Class

I have created a class with one JPanel which will be used for the CardLayout, this works fine if I remove the comment // which has the window size at the bottom of the code. It will run that way and everything functions perfectly. However when I try…
John
  • 315
  • 1
  • 3
  • 8
-2
votes
1 answer

multiple actions off one key press in java

I am trying to create a simple login system and i want the user to be able to proceed to the next part when they hit the enter button, and ive managed to get it working on the registration part, so that when the user has finished putting in their…
-2
votes
1 answer

Open a new frame and close the own frame

Here is the code I use but nothing I am doing it with netbeans; private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { new NewJFrame().setVisible(true); // to open a new frame Menu.setVisible(false); //not working …
manuel.koliqi
  • 313
  • 1
  • 3
  • 11
-3
votes
1 answer

cardlayout java runtime error

import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class Choice extends JDialog{ private JPanel panelMain; private JButton btnPurchase; private JButton btnRefund; …
BTCDude
  • 31
  • 7
-3
votes
2 answers

Card Layout with different classes

I need help with an applet that I am making for my coursework. I am using card layout and I want the content of each card to be taken from different classes. Then in each card I want buttons to switch to other cards. I've seen examples that work in…
darijus
  • 21
  • 5
-3
votes
1 answer

Switch between panels using cardLayout?

I have a single frame and multiple panels, which implement draw operation . I want to switch between them. I am using cardLayout, but am unable to do so. Frame code : import java.awt.CardLayout; import javax.swing.SwingUtilities; import…
user3598542
  • 61
  • 1
  • 10
1 2 3
37
38