Scroll bar problems ..Please help!!!!!!
This is what the program looks like. topPanel has newItemPanel on top of it. when you click continue newItemPanel becomes invisible and newItemDescriptionPanel becomes visible. When you click continue newItemDescriptionPanel becomes invisible and priceEnterPanel becomes visible.
I want newItemDescriptionPanel and priceEnterPanel to have a scroll bar. but everything I have tried hasn't worked. I am new. You will see the code is ugly and there is an attempt to add a scrollbar.
Please help
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.border.*;
import java.lang.System;
public class MainPanel extends JFrame implements ActionListener
private boolean firstRun = true;
private final int ITEM_PLAIN = 0; // Item types
private final int ITEM_CHECK = 1;
private final int ITEM_RADIO = 2;
private JPanel topPanel;
private JPanel newItemPanel;
private JRadioButton onlineAuctionRadio;
private JRadioButton fixedPriceRadio;
private ButtonGroup bg;
private JButton continueButton;
private JLabel blankLabel; //used to give space between things
private JPanel newItemDescriptionPanel;
private JPanel takeAdditionalSpacePanelCheckBox;
private JPanel takeAdditionalSpacePanel;
private JPanel takeAdditionalSpacePanelLabel;
private JPanel takeAdditionalSpacePanelLabel2;
private JPanel takeAdditionalSpacePanel2;
private JPanel takeAdditionalSpacePanel3;
private JPanel takeAdditionalSpacePanel4;
private JPanel takeAdditionalSpacePanel5;
JScrollPane displayScroller;
JEditorPane itemDescriptionTextArea;
GridBagLayout gridbag;
GridBagConstraints gbc;
private JCheckBox secondCategoryCheckBox;
private JLabel itemTitleLabel;
private JLabel requiredLabel, requiredLabel2;
private JLabel requiredStarLabel;
private JTextField itemTitleTextField;
private JLabel subtitleLabel;
private JTextField subtitleTextField;
private JLabel itemDescriptionLabel;
private JButton itemDescriptionContinueButton;
private JLabel percentageLabel;
//------- price enter page ----------------
private JLabel startingPriceLabel;
private JLabel dollarSignLabel;
private JTextField startingPriceTextField;
private JPanel fillUpSpacePanel;
private JPanel fillUpSpacePanel1;
private JPanel fillUpSpacePanel2;
private JLabel buyItNowLabel;
private JPanel fillUpSpacePanel3;
private JLabel dollarSignLabel2;
private JTextField buyItNowTextField;
private JPanel fillUpSpacePanel4;
private JPanel fillUpSpacePanel5;
private JPanel fillUpSpacePanel6;
private JPanel fillUpSpacePanel7;
private JPanel fillUpSpacePanel8;
private JPanel fillUpSpacePanel9;
private JPanel fillUpSpacePanel10;
private JPanel fillUpSpacePanel11;
private JPanel fillUpSpacePanel12;
private JPanel fillUpSpacePanel13;
private JPanel fillUpSpacePanel14;
private JPanel fillUpSpacePanel15;
private JPanel fillUpSpacePanel16;
private JPanel fillUpSpacePanel17;
private JPanel fillUpSpacePanel18;
private JLabel donatePercentageLabel;
private JTextField donatePercentageTextField;
private JPanel fSp; // fill space panel
private JPanel fSp1;
private JPanel fSp2;
private JPanel fSp3;
private JPanel fSp4;
private JPanel fSp5;
private JPanel fSp6;
private JPanel fSp7;
private JPanel fSp8;
private JPanel fSp9;
private JLabel numberOfPicturesLabel;
private JTextField numberOfPicturesTextField;
private JCheckBox superSizePicturesCheckBox;
private JLabel superSizePicturesLabel;
private JRadioButton standardPictureRadioButton;
private JRadioButton picturePackRadioButton;
private JCheckBox listingDesignerCheckBox;
private ButtonGroup bgPictures;
private JCheckBox valuePackCheckBox;
private JCheckBox galleryPictureCheckBox;
private JCheckBox subtitleCheckBox;
private JCheckBox boldCheckBox;
private JCheckBox borderCheckBox;
private JCheckBox highlightCheckBox;
private JCheckBox featuredPlusCheckBox;
private JCheckBox galleryFeaturedCheckBox;
private JLabel homePageFeaturedLabel;
private JComboBox homePageFeaturedComboBox;
private JCheckBox giftCheckBox;
JScrollPane priceEnterPanelScroll;
private JButton backToRadioButton;
private JButton backToItemDescriptionButton;
private JPanel priceEnterPanel;
private final static String RADIOPANEL = "JPanel with radios";
private final static String DESCRIPTIONPANEL = "JPanel with description";
private final static String PRICEENTERPANEL = "JPanel with price entering";
private JPanel cards;
private JMenuBar menuBar;
private JMenu menuFile;
private JMenu menuEdit;
private JMenu menuProperty;
private JMenuItem menuPropertySystem;
private JMenuItem menuPropertyEditor;
private JMenuItem menuPropertyDisplay;
private JMenu menuFileNew;
private JMenuItem menuFileNewAccount;
private JMenuItem menuFileNewItem;
private JMenuItem menuFileOpen;
private JMenuItem menuFileSave;
private JMenuItem menuFileSaveAs;
private JMenuItem menuFileExit;
private JMenuItem menuEditCopy;
private JMenuItem menuEditCut;
private JMenuItem menuEditPaste;
public MainPanel()
requiredLabel = new JLabel ("* Required");
requiredLabel.setForeground (Color.red);
requiredLabel2 = new JLabel ("* Required");
requiredLabel2.setForeground (Color.red);
requiredStarLabel = new JLabel ("*");
requiredStarLabel.setForeground (Color.green);
setTitle( "photo galleries" );
setSize( 310, 130 );
topPanel = new JPanel();
topPanel.setLayout( new BorderLayout() );
topPanel.setBorder (BorderFactory.createTitledBorder ("TopPanel"));
//topPanel.setPreferredSize(new Dimension (300,300));
getContentPane().add( topPanel );
topPanel.setVisible (false);
// For New Item Panel
ButtonListener ears = new ButtonListener();
blankLabel = new JLabel (" "); // used to give space between radio buttons and continue button
continueButton = new JButton ("Continue >");
continueButton.addActionListener (ears);
backToRadioButton = new JButton ("< back");
backToRadioButton.addActionListener (ears);
itemDescriptionContinueButton = new JButton ("Continue >");
itemDescriptionContinueButton.addActionListener (ears);
backToItemDescriptionButton = new JButton ("< back");
backToItemDescriptionButton.addActionListener (ears);
newItemPanel = new JPanel();
newItemPanel.setLayout (new BoxLayout(newItemPanel, BoxLayout.Y_AXIS));
//topPanel.add (newItemPanel, BorderLayout.NORTH);
newItemPanel.setBorder (BorderFactory.createTitledBorder ("NewItemPanel"));
newItemPanel.setVisible (false);
onlineAuctionRadio = new JRadioButton ("Sold item at online Auction" );
fixedPriceRadio = new JRadioButton ("Sold at a Fixed Price");
bg = new ButtonGroup();
bg.add(onlineAuctionRadio);
bg.add(fixedPriceRadio);
onlineAuctionRadio.addActionListener (ears);
fixedPriceRadio.addActionListener (ears);
newItemPanel.add (onlineAuctionRadio);
newItemPanel.add (fixedPriceRadio);
newItemPanel.add (blankLabel);
newItemPanel.add (continueButton);
// ------ After continue pressed ---------
newItemDescriptionPanel = new JPanel();
newItemDescriptionPanel.setLayout (new BoxLayout(newItemDescriptionPanel, BoxLayout.Y_AXIS));
newItemPanel.add (newItemDescriptionPanel, BorderLayout.NORTH);
newItemDescriptionPanel.setBorder (BorderFactory.createTitledBorder ("newItemDescriptionPanel"));
secondCategoryCheckBox = new JCheckBox ("The item was listed in a second category");
newItemDescriptionPanel.setVisible (false);
itemTitleLabel = new JLabel ("Item title");
itemTitleTextField = new JTextField (30);
subtitleLabel = new JLabel ("Subtitle ($0.50)");
subtitleTextField = new JTextField (30);
itemDescriptionLabel = new JLabel ("Item description");
itemDescriptionTextArea = new JEditorPane();
itemDescriptionTextArea.setContentType( "text/html" );
itemDescriptionTextArea.setEditable( false );
itemDescriptionTextArea.setPreferredSize(new Dimension (500,250));
itemDescriptionTextArea.setFont(new Font( "Serif", Font.PLAIN, 12 ));
itemDescriptionTextArea.setForeground( Color.black );
gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 4;
displayScroller = new JScrollPane( itemDescriptionTextArea );
gridbag = new GridBagLayout ();
gridbag.setConstraints( displayScroller, gbc );
itemDescriptionTextArea.setEditable( true );
takeAdditionalSpacePanelCheckBox = new JPanel(new FlowLayout(FlowLayout.LEFT));
takeAdditionalSpacePanel = new JPanel(new FlowLayout(FlowLayout.LEFT));//<--added, to take additional space
takeAdditionalSpacePanelLabel = new JPanel(new FlowLayout(FlowLayout.LEFT));//<--added, to take additional space
takeAdditionalSpacePanelLabel2 = new JPanel(new FlowLayout(FlowLayout.LEFT));//<--added, to take additional space
takeAdditionalSpacePanel2 = new JPanel(new FlowLayout(FlowLayout.LEFT));//<--added, to take additional space
takeAdditionalSpacePanel3 = new JPanel(new FlowLayout(FlowLayout.LEFT));//<--added, to take additional space
takeAdditionalSpacePanel4 = new JPanel(new FlowLayout(FlowLayout.LEFT));
takeAdditionalSpacePanel5 = new JPanel(new FlowLayout(FlowLayout.LEFT));
//takeAdditionalSpacePanel2.setBorder (BorderFactory.createTitledBorder ("Additonal 2"));
takeAdditionalSpacePanelCheckBox.add (secondCategoryCheckBox);
newItemDescriptionPanel.add (takeAdditionalSpacePanelCheckBox);
//newItemDescriptionPanel.add (blankLabel);
takeAdditionalSpacePanelLabel.add (itemTitleLabel);
takeAdditionalSpacePanelLabel.add (requiredLabel);
newItemDescriptionPanel.add (takeAdditionalSpacePanelLabel);
//newItemDescriptionPanel.add (itemTitleTextField);
takeAdditionalSpacePanel.add(itemTitleTextField);//<--add textfield to panel
newItemDescriptionPanel.add (takeAdditionalSpacePanel);//<--add panel to boxlayout panel
takeAdditionalSpacePanelLabel2.add (subtitleLabel);
newItemDescriptionPanel.add (takeAdditionalSpacePanelLabel2);
takeAdditionalSpacePanel2.add (subtitleTextField);
newItemDescriptionPanel.add (takeAdditionalSpacePanel2);
takeAdditionalSpacePanel4.add (itemDescriptionLabel);
//takeAdditionalSpacePanel4.add (requiredLabel2);
newItemDescriptionPanel.add (takeAdditionalSpacePanel4);
takeAdditionalSpacePanel3.add (displayScroller);
newItemDescriptionPanel.add (takeAdditionalSpacePanel3);
takeAdditionalSpacePanel5.add (backToRadioButton);
takeAdditionalSpacePanel5.add (itemDescriptionContinueButton);
newItemDescriptionPanel.add (takeAdditionalSpacePanel5);
//newItemDescriptionPanel.setLayout (new BoxLayout(newItemDescriptionPanel, BoxLayout.Y_AXIS));
//----------- Price Enter Page ----------------
priceEnterPanel = new JPanel();
priceEnterPanel.setLayout (new BoxLayout(priceEnterPanel, BoxLayout.Y_AXIS));
newItemDescriptionPanel.add (priceEnterPanel, BorderLayout.NORTH);
priceEnterPanel.setBorder (BorderFactory.createTitledBorder ("Price enter Panel"));
priceEnterPanel.setVisible (false);
priceEnterPanelScroll = new JScrollPane (priceEnterPanel);
topPanel.add (priceEnterPanelScroll);
standardPictureRadioButton = new JRadioButton ("Standard");
picturePackRadioButton = new JRadioButton ("Picture Pack ($1.00 for up to 6 pictures or $1.50 for 7 to 12 pictures)");
bgPictures = new ButtonGroup();
bgPictures.add(standardPictureRadioButton);
bgPictures.add(picturePackRadioButton);
standardPictureRadioButton.addActionListener (ears);
picturePackRadioButton.addActionListener (ears);
superSizePicturesCheckBox = new JCheckBox ("Supersize Pictures ($0.75)");
listingDesignerCheckBox = new JCheckBox ("Listing designer $0.10");
valuePackCheckBox = new JCheckBox ("Get the Essentials for less! Gallery, Subtitle, Listing Designer. $0.65 (save $0.30)");
superSizePicturesCheckBox.setEnabled (false);
superSizePicturesCheckBox.addActionListener (ears);
listingDesignerCheckBox.addActionListener (ears);
valuePackCheckBox.addActionListener (ears);
startingPriceLabel = new JLabel ("Starting Price");
dollarSignLabel = new JLabel ("$");
startingPriceTextField = new JTextField (10);
buyItNowLabel = new JLabel ("Buy It Now");
dollarSignLabel2 = new JLabel ("$");
buyItNowTextField = new JTextField (10);
donatePercentageLabel = new JLabel ("Donate percentage of sale");
donatePercentageTextField = new JTextField (2);
donatePercentageTextField.setText ("0");
percentageLabel = new JLabel ("%");
// Right-justify the text
donatePercentageTextField.setHorizontalAlignment(JTextField.RIGHT);
numberOfPicturesLabel = new JLabel ("Number of pictures used");
numberOfPicturesTextField = new JTextField (1);
numberOfPicturesTextField.setText ("0");
galleryPictureCheckBox = new JCheckBox ("Gallery ($0.35) [Requires a picture]");
subtitleCheckBox = new JCheckBox ("Subtitle ($0.50)");
boldCheckBox = new JCheckBox ("Bold ($1.00)");
borderCheckBox = new JCheckBox ("Border ($3.00)");
highlightCheckBox = new JCheckBox ("Highlight ($5.00)");
featuredPlusCheckBox = new JCheckBox ("Featured Plus! ($19.95)");
galleryFeaturedCheckBox = new JCheckBox ("Gallery Featured ($19.95) [Requires a picture]");
homePageFeaturedLabel = new JLabel ("Home Page Featured ($39.95 for 1 item, $79.95 for 2 or more items)");
homePageFeaturedComboBox = new JComboBox ();
homePageFeaturedComboBox.addItem (("None..."));
homePageFeaturedComboBox.addItem (("1 item"));
homePageFeaturedComboBox.addItem (("2 or more items"));
giftCheckBox = new JCheckBox ("Show as a gift ($0.25)");
fillUpSpacePanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
fillUpSpacePanel1 = new JPanel(new FlowLayout(FlowLayout.LEFT));
fillUpSpacePanel2 = new JPanel(new FlowLayout(FlowLayout.LEFT));
fillUpSpacePanel3 = new JPanel(new FlowLayout(FlowLayout.LEFT));
fillUpSpacePanel4 = new JPanel(new FlowLayout(FlowLayout.LEFT));
fillUpSpacePanel5 = new JPanel(new FlowLayout(FlowLayout.LEFT));
fillUpSpacePanel6 = new JPanel(new FlowLayout(FlowLayout.LEFT));
fillUpSpacePanel7 = new JPanel(new FlowLayout(FlowLayout.LEFT));
fillUpSpacePanel8 = new JPanel(new FlowLayout(FlowLayout.LEFT));
fillUpSpacePanel9 = new JPanel(new FlowLayout(FlowLayout.LEFT));
fillUpSpacePanel10 = new JPanel(new FlowLayout(FlowLayout.LEFT));
fillUpSpacePanel11 = new JPanel(new FlowLayout(FlowLayout.LEFT));
fillUpSpacePanel12 = new JPanel(new FlowLayout(FlowLayout.LEFT));
fillUpSpacePanel13 = new JPanel(new FlowLayout(FlowLayout.LEFT));
fillUpSpacePanel14 = new JPanel(new FlowLayout(FlowLayout.LEFT));
fillUpSpacePanel15 = new JPanel(new FlowLayout(FlowLayout.LEFT));
fillUpSpacePanel16 = new JPanel(new FlowLayout(FlowLayout.LEFT));
fillUpSpacePanel17 = new JPanel(new FlowLayout(FlowLayout.LEFT));
fillUpSpacePanel18 = new JPanel(new FlowLayout(FlowLayout.LEFT));
fSp = new JPanel(new FlowLayout(FlowLayout.LEFT));
fSp1 = new JPanel(new FlowLayout(FlowLayout.LEFT));
fSp2 = new JPanel(new FlowLayout(FlowLayout.LEFT));
fSp3 = new JPanel(new FlowLayout(FlowLayout.LEFT));
fSp4 = new JPanel(new FlowLayout(FlowLayout.LEFT));
fSp5 = new JPanel(new FlowLayout(FlowLayout.LEFT));
fSp6 = new JPanel(new FlowLayout(FlowLayout.LEFT));
fSp7 = new JPanel(new FlowLayout(FlowLayout.LEFT));
fSp8 = new JPanel(new FlowLayout(FlowLayout.LEFT));
fSp9 = new JPanel(new FlowLayout(FlowLayout.LEFT));
fillUpSpacePanel.add (startingPriceLabel);
fillUpSpacePanel.add (requiredLabel2);
priceEnterPanel.add (fillUpSpacePanel);
fillUpSpacePanel2.add (dollarSignLabel);
fillUpSpacePanel2.add (startingPriceTextField);
priceEnterPanel.add (fillUpSpacePanel2);
// fillUpSpacePanel1.add (backToItemDescriptionButton);
// priceEnterPanel.add (fillUpSpacePanel1);
fillUpSpacePanel3.add (buyItNowLabel);
priceEnterPanel.add (fillUpSpacePanel3);
fillUpSpacePanel4.add (dollarSignLabel2);
fillUpSpacePanel4.add (buyItNowTextField);
priceEnterPanel.add (fillUpSpacePanel4);
fillUpSpacePanel1.add (donatePercentageLabel);
priceEnterPanel.add (fillUpSpacePanel1);
fillUpSpacePanel5.add (donatePercentageTextField);
fillUpSpacePanel5.add (percentageLabel);
priceEnterPanel.add (fillUpSpacePanel5);
fillUpSpacePanel6.add (numberOfPicturesLabel);
priceEnterPanel.add (fillUpSpacePanel6);
fillUpSpacePanel7.add (numberOfPicturesTextField);
priceEnterPanel.add (fillUpSpacePanel7);
fillUpSpacePanel8.add (standardPictureRadioButton);
priceEnterPanel.add (fillUpSpacePanel8);
fillUpSpacePanel10.add (blankLabel);
fillUpSpacePanel10.add (superSizePicturesCheckBox);
priceEnterPanel.add (fillUpSpacePanel10);
fillUpSpacePanel9.add (picturePackRadioButton);
priceEnterPanel.add (fillUpSpacePanel10);
fillUpSpacePanel11.add (picturePackRadioButton);
priceEnterPanel.add (fillUpSpacePanel11);
fillUpSpacePanel12.add (listingDesignerCheckBox);
priceEnterPanel.add (fillUpSpacePanel12);
fillUpSpacePanel13.add (valuePackCheckBox);
priceEnterPanel.add (fillUpSpacePanel13);
fSp.add (galleryPictureCheckBox);
priceEnterPanel.add (fSp);
fSp1.add (subtitleCheckBox);
priceEnterPanel.add (fSp1);
fSp2.add (boldCheckBox);
priceEnterPanel.add (fSp2);
fSp3.add (borderCheckBox);
priceEnterPanel.add (fSp3);
fSp4.add (highlightCheckBox);
priceEnterPanel.add (fSp4);
fSp5.add (featuredPlusCheckBox);
priceEnterPanel.add (fSp5);
fSp6.add (galleryFeaturedCheckBox);
priceEnterPanel.add (fSp6);
fSp7.add (homePageFeaturedLabel);
priceEnterPanel.add (fSp7);
fSp8.add (homePageFeaturedComboBox);
priceEnterPanel.add (fSp8);
fSp9.add (giftCheckBox);
priceEnterPanel.add (fSp9);
newItemDescriptionPanel.add (priceEnterPanelScroll);
//Create the panel that contains the "cards".
cards = new JPanel(new CardLayout());
cards.add(newItemPanel, RADIOPANEL);
cards.add(newItemDescriptionPanel, DESCRIPTIONPANEL);
cards.add(priceEnterPanel, PRICEENTERPANEL);
topPanel.add(cards, BorderLayout.NORTH);
// Create the menu bar
menuBar = new JMenuBar();
// Set this instance as the application's menu bar
setJMenuBar( menuBar );
// Build the property sub-menu
menuProperty = new JMenu( "Properties" );
menuProperty.setMnemonic( 'P' );
// Create property items
menuPropertySystem = CreateMenuItem( menuProperty, ITEM_PLAIN,
"System...", null, 'S', null );
menuPropertyEditor = CreateMenuItem( menuProperty, ITEM_PLAIN,
"Editor...", null, 'E', null );
menuPropertyDisplay = CreateMenuItem( menuProperty, ITEM_PLAIN,
"Display...", null, 'D', null );
//Build the File-New sub-menu
menuFileNew = new JMenu ("New");
menuFileNew.setMnemonic ('N');
//Create File-New items
menuFileNewItem = CreateMenuItem( menuFileNew, ITEM_PLAIN,
"Item", null, 'A', null );
menuFileNewAccount = CreateMenuItem( menuFileNew, ITEM_PLAIN,
"Account", null, 'A', null );
// Create the file menu
menuFile = new JMenu( "File" );
menuFile.setMnemonic( 'F' );
menuBar.add( menuFile );
//Add the File-New menu
menuFile.add( menuFileNew );
// Create the file menu
// Build a file menu items
menuFileOpen = CreateMenuItem( menuFile, ITEM_PLAIN, "Open...",
new ImageIcon( "open.gif" ), 'O',
"Open a new file" );
menuFileSave = CreateMenuItem( menuFile, ITEM_PLAIN, "Save",
new ImageIcon( "save.gif" ), 'S',
" Save this file" );
menuFileSaveAs = CreateMenuItem( menuFile, ITEM_PLAIN,
"Save As...", null, 'A',
"Save this data to a new file" );
// Add the property menu
menuFile.addSeparator();
menuFile.add( menuProperty );
menuFile.addSeparator();
menuFileExit = CreateMenuItem( menuFile, ITEM_PLAIN,
"Exit", null, 'X',
"Exit the program" );
//menuFileExit.addActionListener(this);
// Create the file menu
menuEdit = new JMenu( "Edit" );
menuEdit.setMnemonic( 'E' );
menuBar.add( menuEdit );
// Create edit menu options
menuEditCut = CreateMenuItem( menuEdit, ITEM_PLAIN,
"Cut", null, 'T',
"Cut data to the clipboard" );
menuEditCopy = CreateMenuItem( menuEdit, ITEM_PLAIN,
"Copy", null, 'C',
"Copy data to the clipboard" );
menuEditPaste = CreateMenuItem( menuEdit, ITEM_PLAIN,
"Paste", null, 'P',
"Paste data from the clipboard" );
public JMenuItem CreateMenuItem( JMenu menu, int iType, String sText,
ImageIcon image, int acceleratorKey,
String sToolTip )
// Create the item
JMenuItem menuItem;
switch( iType )
case ITEM_RADIO:
menuItem = new JRadioButtonMenuItem();
break;
case ITEM_CHECK:
menuItem = new JCheckBoxMenuItem();
break;
default:
menuItem = new JMenuItem();
break;
// Add the item test
menuItem.setText( sText );
// Add the optional icon
if( image != null )
menuItem.setIcon( image );
// Add the accelerator key
if( acceleratorKey > 0 )
menuItem.setMnemonic( acceleratorKey );
// Add the optional tool tip text
if( sToolTip != null )
menuItem.setToolTipText( sToolTip );
// Add an action handler to this menu item
menuItem.addActionListener( this );
menu.add( menuItem );
return menuItem;
public void actionPerformed( ActionEvent event )
CardLayout cl = (CardLayout)(cards.getLayout());
if (event.getSource() == menuFileExit)
System.exit(0);
if (event.getSource() == menuFileNewAccount)
System.out.println ("hlkadflkajfalkdjfalksfj");
if (event.getSource() == menuFileNewItem){
if (firstRun){
newItemPanel.setVisible (true);
topPanel.setVisible (true);
cl.show(cards,RADIOPANEL);
firstRun = false;
//System.out.println( event );
private class ButtonListener implements ActionListener
public void actionPerformed(ActionEvent event)
CardLayout cl = (CardLayout)(cards.getLayout());
// cl.show(cards, (String)evt.getItem());
if (event.getSource() == continueButton){
if (!(onlineAuctionRadio.isSelected()) && !(fixedPriceRadio.isSelected()))
JOptionPane.showMessageDialog(null, "You must select at least one.", "Error", JOptionPane.ERROR_MESSAGE);
else{
if (onlineAuctionRadio.isSelected()){
cl.show (cards, DESCRIPTIONPANEL);
//newItemPanel.setVisible (false);
//newItemDescriptionPanel.setVisible (true);
if (event.getSource() == itemDescriptionContinueButton){
if (itemTitleTextField.getText().trim().equalsIgnoreCase(""))
JOptionPane.showMessageDialog(null, "You must enter a title.", "Error", JOptionPane.ERROR_MESSAGE);
else
cl.show (cards, PRICEENTERPANEL);
if (event.getSource() == backToRadioButton){
cl.show (cards, RADIOPANEL);
if (event.getSource() == backToItemDescriptionButton){
cl.show(cards, DESCRIPTIONPANEL);
if (standardPictureRadioButton.isSelected()){
superSizePicturesCheckBox.setEnabled (true);
if (picturePackRadioButton.isSelected()){
superSizePicturesCheckBox.setEnabled (false);
} //end of action performed
}
Mostly I see there is about 100 times as much code as I care to look at.
So you don't know how to get a panel in a scroll pane, and then get that scroll pane into your GUI? Then try doing that by itself, not encumbered with 10000 lines of irrelevant code. Once you have it working, plug it into the big lump of code. Or if you can't get it working, ask about the small problem here.
Similar Messages
-
Scroll Bar Troubles, Please Help.
When In A WebPage, I Have No Scroll Bars, And The Up And Down Arrows Will Not Scroll The Page Either. The Only Way I Can Scroll Is By Dragging The Screen Up And Down By Highlighting And It's Rather Bugging Now. I'm New To Macs By Two Weeks So Please Please Help.
ThankYou.What browser are you using? Do you get this condition on all web pages you access?
-
Nav bar problems; please help.
Home
Birthday
Anniversary
For Her
For Him
For Mom
For Dad
Just Because
Making Up
Can anyone help? This is the html for my nav bar, but when I "view in browser" I get a cannot display page message.Judging from your previous post, you seem to be having a problem with copying and pasting your code here. The following has been made by doing exactly that, copy from DW and paste here.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled</title>
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
</head>
<body>
<ul id="MenuBar1" class="MenuBarHorizontal">
<li> <a href="index.html">Home</a></li>
<li> <a href="birthday.html">Birthday</a></li>
<li> <a href="anniversary.html">Anniversary</a></li>
<li> <a href="forher.html">For Her</a></li>
<li> <a href="forhim.html">For Him</a></li>
<li> <a href="formom">For Mom</a></li>
<li> <a href="fordad.html">For Dad</a></li>
<li> <a href="justbecause">Just Because</a></li>
<li> <a href="makingup">Making Up</a></li>
</ul>
<script type="text/javascript">
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
</script>
</body>
</html>
Incidently, the above code works.
Gramps -
I have an iPod Nano that is synced to my mac, but it is sent in for the battery issue. Anyway, I have bought a 2nd gerneration Ipod touch and I want to now sync it to my mac, but it does not show up in the left menu bar. Please help. Thanks All!
http://support.apple.com/kb/TS1591
There have been some problems accessing pages on the Apple web site. If the hyperlink gives you a "We're sorry" message, try again. -
I'm in trouble, my iPod Touch is giving 4th shock when recharge and the battery does not last any more. who knows or has a similar problem, please help me. Note: all this after I downloaded the new version OS5.
I would make an appointment at the Genius Bar of an Apple store because of the shock issue. I doubt it was caused by the update.
-
my iphone 4 is acting like crap right i can't even restore it everytime i try to reboot it my iphone freezes at the apple logo it is ******* me off to the point where i just want to smash it how do i solve this problem please help?
Don't worry, just follow these steps to fix iPhone stuck on Apple logo
=> First of all Start your Computer and then connect with Internet connection, now Download the latest version of the iTunes application
=> Now install the iTunes application in your System and connect your Device with computer via Data cable
=> Now connect your Device with iTunes application and then Tab on summary option, see in the left side bar of iTunes
=> Now Select restore option from iTunes and then confirm the Restore Message for better results. After this unplug your Device and Restart it
I hope that will surely
Thank you... -
I've upgraded to 13.I can't see fonts in search bar & tabs.Please help.If u need screenshots,please share me the site of image sharing.Thanks!
[http://www.flickr.com/photos/80001361@N06/7346073414/in/photostream http://www.flickr.com/photos/80001361@N06/7346073414/in/photostream]Looks like a font problem.<br />
Firefox seems to be using a font that isn't working properly.
Try this solution: [[/questions/927322#answer-336404]] -
my iphone is on recovery mode and i can´t turn on it, when i try to recover it from itunes i get: unknown error (36), i´ve tried to do lot of things but i can´t solve my problem. please help!!
Hi, i had the same problem. Try to find the file "apple" or "itunes" don't know it anymore exactly. Ahm well you need to delet any information or just plug in your iphone into an other computer. important is that your iphone never has been pluged in this computer before. This was what i did, and it worked!
-
Problem Please help me.....Let me know the area to look for it I am a DBA..Thanks in advance to let me know the cause and the area to look and fix it...
Server Error in '/' Application.
Problem with SAP/BAPI. SAP.Connector.RfcCommunicationException: Connect to message server failed Connect_PM MSHOST=prddb01.lamrc.com, R3NAME=PRD, GROUP=Prod HR PRD LOCATION CPIC (TCP/IP) on local host ERROR service 'sapmsPRD' unknown TIME Wed May 04 08:59:06 2005 RELEASE 620 COMPONENT NI (network interface) VERSION 36 RC -3 MODULE ninti.c LINE 428 DETAIL NiPServToNo SYSTEM CALL getservbyname COUNTER 1 at SAP.Connector.SAPConnection.ThrowRfcException(RFC_ERROR_INFO_EX rfcerrInfo, Encoding encoding, String languangeCode) at SAP.Connector.SAPConnection.Open() at SAP.Connector.SAPClient.RfcInvoke(String method, Object[] methodParamsIn) at SAP.Connector.SAPClient.SAPInvoke(String method, Object[] methodParamsIn) at SoftwareKeySAPG.SAPProxy1.Z_Bapi_Load_Kpi_Region(ZSOFT_KPI_REGIONS_MTable& Kpi_Regions, ZSOFT_PROD_TYPETable& Prod_Type) at SoftwareKeySAPG.SAPGSK.LoadKPIRegion(DataSet dsProduct)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.Services.Protocols.SoapException: Problem with SAP/BAPI. SAP.Connector.RfcCommunicationException: Connect to message server failed Connect_PM MSHOST=prddb01.lamrc.com, R3NAME=PRD, GROUP=Prod HR PRD LOCATION CPIC (TCP/IP) on local host ERROR service 'sapmsPRD' unknown TIME Wed May 04 08:59:06 2005 RELEASE 620 COMPONENT NI (network interface) VERSION 36 RC -3 MODULE ninti.c LINE 428 DETAIL NiPServToNo SYSTEM CALL getservbyname COUNTER 1 at SAP.Connector.SAPConnection.ThrowRfcException(RFC_ERROR_INFO_EX rfcerrInfo, Encoding encoding, String languangeCode) at SAP.Connector.SAPConnection.Open() at SAP.Connector.SAPClient.RfcInvoke(String method, Object[] methodParamsIn) at SAP.Connector.SAPClient.SAPInvoke(String method, Object[] methodParamsIn) at SoftwareKeySAPG.SAPProxy1.Z_Bapi_Load_Kpi_Region(ZSOFT_KPI_REGIONS_MTable& Kpi_Regions, ZSOFT_PROD_TYPETable& Prod_Type) at SoftwareKeySAPG.SAPGSK.LoadKPIRegion(DataSet dsProduct)
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SoapException: Problem with SAP/BAPI.
SAP.Connector.RfcCommunicationException: Connect to message server failed
Connect_PM MSHOST=prddb01.lamrc.com, R3NAME=PRD, GROUP=Prod HR PRD
LOCATION CPIC (TCP/IP) on local host
ERROR service 'sapmsPRD' unknown
TIME Wed May 04 08:59:06 2005
RELEASE 620
COMPONENT NI (network interface)
VERSION 36
RC -3
MODULE ninti.c
LINE 428
DETAIL NiPServToNo
SYSTEM CALL getservbyname
COUNTER 1
at SAP.Connector.SAPConnection.ThrowRfcException(RFC_ERROR_INFO_EX rfcerrInfo, Encoding encoding, String languangeCode)
at SAP.Connector.SAPConnection.Open()
at SAP.Connector.SAPClient.RfcInvoke(String method, Object[] methodParamsIn)
at SAP.Connector.SAPClient.SAPInvoke(String method, Object[] methodParamsIn)
at SoftwareKeySAPG.SAPProxy1.Z_Bapi_Load_Kpi_Region(ZSOFT_KPI_REGIONS_MTable& Kpi_Regions, ZSOFT_PROD_TYPETable& Prod_Type)
at SoftwareKeySAPG.SAPGSK.LoadKPIRegion(DataSet dsProduct)]
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +1503
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +218
SoftwareKeyUI.InstalledBaseDataWS.InstalledBaseData.LoadKPIRegionMulti(DataSet products)
SoftwareKeyUI.InstalledBaseDataAccess.LoadKPIRegionMulti(DataSet products)
SoftwareKeyUI.InstalledBase.GetRegionDetails(Int32 userId, String product, String regionType)
SoftwareKeyUI.FilteredAccess.GetRegionDetails(Int32 userId, String product, String regionType)
SoftwareKeyUI.search.LoadRegionDetails()
SoftwareKeyUI.search.regionType_SelectedIndexChanged(Object sender, EventArgs e)
System.Web.UI.WebControls.ListControl.OnSelectedIndexChanged(EventArgs e) +108
System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent() +26
System.Web.UI.Page.RaiseChangedEvents() +115
System.Web.UI.Page.ProcessRequestMain() +1099The error is a very basic one - the sapmsPRD service is not known. You will have to go to <NT_ROOT>\system32\drivers\etc and add the entry sapmsPRD 3600 to this file.
This is basically telling the requester at what port to look for the message server.
C -
Problem Please help me.....Let me know the area to look for it
Problem Please help me.....Let me know the area to look for it I am a DBA..Thanks in advance to let me know the cause and the area to look and fix it...
Server Error in '/' Application.
Problem with SAP/BAPI. SAP.Connector.RfcCommunicationException: Connect to message server failed Connect_PM MSHOST=prddb01.lamrc.com, R3NAME=PRD, GROUP=Prod HR PRD LOCATION CPIC (TCP/IP) on local host ERROR service 'sapmsPRD' unknown TIME Wed May 04 08:59:06 2005 RELEASE 620 COMPONENT NI (network interface) VERSION 36 RC -3 MODULE ninti.c LINE 428 DETAIL NiPServToNo SYSTEM CALL getservbyname COUNTER 1 at SAP.Connector.SAPConnection.ThrowRfcException(RFC_ERROR_INFO_EX rfcerrInfo, Encoding encoding, String languangeCode) at SAP.Connector.SAPConnection.Open() at SAP.Connector.SAPClient.RfcInvoke(String method, Object[] methodParamsIn) at SAP.Connector.SAPClient.SAPInvoke(String method, Object[] methodParamsIn) at SoftwareKeySAPG.SAPProxy1.Z_Bapi_Load_Kpi_Region(ZSOFT_KPI_REGIONS_MTable& Kpi_Regions, ZSOFT_PROD_TYPETable& Prod_Type) at SoftwareKeySAPG.SAPGSK.LoadKPIRegion(DataSet dsProduct)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.Services.Protocols.SoapException: Problem with SAP/BAPI. SAP.Connector.RfcCommunicationException: Connect to message server failed Connect_PM MSHOST=prddb01.lamrc.com, R3NAME=PRD, GROUP=Prod HR PRD LOCATION CPIC (TCP/IP) on local host ERROR service 'sapmsPRD' unknown TIME Wed May 04 08:59:06 2005 RELEASE 620 COMPONENT NI (network interface) VERSION 36 RC -3 MODULE ninti.c LINE 428 DETAIL NiPServToNo SYSTEM CALL getservbyname COUNTER 1 at SAP.Connector.SAPConnection.ThrowRfcException(RFC_ERROR_INFO_EX rfcerrInfo, Encoding encoding, String languangeCode) at SAP.Connector.SAPConnection.Open() at SAP.Connector.SAPClient.RfcInvoke(String method, Object[] methodParamsIn) at SAP.Connector.SAPClient.SAPInvoke(String method, Object[] methodParamsIn) at SoftwareKeySAPG.SAPProxy1.Z_Bapi_Load_Kpi_Region(ZSOFT_KPI_REGIONS_MTable& Kpi_Regions, ZSOFT_PROD_TYPETable& Prod_Type) at SoftwareKeySAPG.SAPGSK.LoadKPIRegion(DataSet dsProduct)
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SoapException: Problem with SAP/BAPI.
SAP.Connector.RfcCommunicationException: Connect to message server failed
Connect_PM MSHOST=prddb01.lamrc.com, R3NAME=PRD, GROUP=Prod HR PRD
LOCATION CPIC (TCP/IP) on local host
ERROR service 'sapmsPRD' unknown
TIME Wed May 04 08:59:06 2005
RELEASE 620
COMPONENT NI (network interface)
VERSION 36
RC -3
MODULE ninti.c
LINE 428
DETAIL NiPServToNo
SYSTEM CALL getservbyname
COUNTER 1
at SAP.Connector.SAPConnection.ThrowRfcException(RFC_ERROR_INFO_EX rfcerrInfo, Encoding encoding, String languangeCode)
at SAP.Connector.SAPConnection.Open()
at SAP.Connector.SAPClient.RfcInvoke(String method, Object[] methodParamsIn)
at SAP.Connector.SAPClient.SAPInvoke(String method, Object[] methodParamsIn)
at SoftwareKeySAPG.SAPProxy1.Z_Bapi_Load_Kpi_Region(ZSOFT_KPI_REGIONS_MTable& Kpi_Regions, ZSOFT_PROD_TYPETable& Prod_Type)
at SoftwareKeySAPG.SAPGSK.LoadKPIRegion(DataSet dsProduct)]
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +1503
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +218
SoftwareKeyUI.InstalledBaseDataWS.InstalledBaseData.LoadKPIRegionMulti(DataSet products)
SoftwareKeyUI.InstalledBaseDataAccess.LoadKPIRegionMulti(DataSet products)
SoftwareKeyUI.InstalledBase.GetRegionDetails(Int32 userId, String product, String regionType)
SoftwareKeyUI.FilteredAccess.GetRegionDetails(Int32 userId, String product, String regionType)
SoftwareKeyUI.search.LoadRegionDetails()
SoftwareKeyUI.search.regionType_SelectedIndexChanged(Object sender, EventArgs e)
System.Web.UI.WebControls.ListControl.OnSelectedIndexChanged(EventArgs e) +108
System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent() +26
System.Web.UI.Page.RaiseChangedEvents() +115
System.Web.UI.Page.ProcessRequestMain() +1099Hi
You should make a mapping for the service sapmsPRD in your /etc/services file (On Windows: C:WINDOWSSYSTEM32DRIVERSETCservices). If your instance number is 00 you will have to add the following entry:
sapmsPRD 3600/tcp
Good luck!
René van Es -
[TV@Master] Problem please help
I have Msi.mother board PT8-Neo -LSR , Model No.Ms-6799 , main board bios -Phonenix ,maind board version i updat it to 2.2 , cpu size 2.4 G celleron D/256/533 , memory size 256DDram (400),display card Nvidia Riva TNT2 model 64
the problem that i face it when i put my TV@nywhere -master card ,the pc stop at the main page that show the biso version and name of bios company and the letters do not bost well it look like a virus work , and when i take tha card off the pc go normally , i tried put it to other PCI the same problem
please helpi meany by fix the problem of getting the pc go on to windows with card on PCI salot but i still have the broblem of the driver
please read my reply again
my operating system is win me and i have also another pc have XP
when i log in to windows the system show that found my TV@nywhere card but it didnt took the installatin driver for it i tried to install the driver directly
but it give me this 2 mesages when i try to install the driver
MSI TV card is not found ,stop the installation
the other message is
MSI pvs driver installatin failed
i download the driver from msi page also give me the same messages
for known on Device Manager it show me that the driver there but do not have the driver and the ? mark beside them
what to do now -
I want to buy an in-app purchase but i don`t remember my security questions and i cant access my recovery email either, what can i do? i have 100$ on my account and cant use it because of that problem, please help URGENT
If you have a rescue email address on your account then you can use that - follow steps 1 to 5 half-way down this page will give you a reset link on your account : http://support.apple.com/kb/HT5312
If you don't have a rescue email address (you won't be able to add one until you can answer your questions) then you will need to contact Support in your country to get the questions reset : http://support.apple.com/kb/HT5699 -
this is,we've encountered the following issues.
installer failed to initialize.this could be due to a missing file.please download adobe support advisor to detected the problem.
please,help me!Hi there Mylenium, is there any way you can help me? My cs6 is doing all kinds weird things lately. The liquifying too stopped working completely, when I try to work with the actions, it starts flickering and changing opacity in color by itself. It starts flickering and is completely out of whack! I tried uninstalling and reinstalling and still no luck. I tried getting in touch with adobe and no luck with that neither! Is there anyway you might be able to help?
-
My iPad stop working suddenly i see black screen only pressing the home and sleep button dose not solve the problem please help ?
Frozen or unresponsive iPad
Resolve these most common issues:
• Display remains black or blank
• Touch screen not responding
• Application unexpectedly closes or freezes
http://www.apple.com/support/ipad/assistant/ipad/
iPad Frozen, not responding, how to fix
http://appletoolbox.com/2012/07/ipad-frozen-not-responding-how-to-fix/
iPad Frozen? How to Force Quit an App, Reset or Restart Your iPad
http://ipadacademy.com/2010/11/ipad-frozen-how-to-force-quit-an-app-reset-or-res tart-your-ipad
Black or Blank Screen on iPad or iPhone
http://appletoolbox.com/2012/10/black-or-blank-screen-on-ipad-or-iphone/
What to Do When Your iPad Won't Turn On
http://ipad.about.com/od/iPad_Troubleshooting/ss/What-To-Do-When-Your-Ipad-Wo-No t-Turn-On.htm
iOS: Not responding or does not turn on
http://support.apple.com/kb/TS3281
Home button not working or unresponsive, fix
http://appletoolbox.com/2013/04/home-button-not-working-or-unresponsive-fix/
Fixing an iPad Home Button
http://tinyurl.com/om6rd6u
iPad: Basic troubleshooting
http://support.apple.com/kb/TS3274
Cheers, Tom -
i am using firefox 3.6.17 i upgraded it to 4.1.but it does not work properly sometimes it opens every website and most of the time it does not work . so what is the problem please help . thank you
Did you check your security software (firewall)?
A possible cause is security software (firewall) that blocks or restricts Firefox or the plugin-container process without informing you, possibly after detecting changes (update) to the Firefox program.
Remove all rules for Firefox from the permissions list in the firewall and let your firewall ask again for permission to get full unrestricted access to internet for Firefox and the plugin-container process.
See:
* [[Server not found]]
* [[Firewalls]] -
My Ipad 2 does not turn on when not plugged to electricity. Even when plugged to electricity, it constantly restarts/switches itself off. what is the problem, please help??
i plugged it and pressed the home button for a few seconds. the connect to itunes screen appeared and the moment i disconnect the cable from the electric plug, it switches off. when i connect the cable to the PC, nothing happens, its as if nothing has been done.
Maybe you are looking for
-
How to generate WS and WSDL for proper working DS under ALDSP 3.0?
Hi, Ive got small problem with generating WebService and WSDL for proper working DataService in AL Data Service Studio. Whats the worse, I cant find any good documentation showing how to do it step by step in the new development enviroment. Currently
-
Activity Journal Text Not Active - Windows Gui
We have several activity types with associated journals. We create an activity with multiple journal entries. The text type associated with the corresponding journal entry is not active when you select the corresponding journal entry. In order to set
-
Box alignment and sizing problems
I have a JPanel (using a border layout). Its centre part holds a vertical Box, which itself holds two boxes: The top box holds three labels with centre alignment, and the bottom box holds 5 boxes, each displaying details about a product. All the comp
-
Driver Win7 x64 bit for S10-3s and s10-3
hi all... where i found driver lenovo s10-3s and s10-3 for win7 x64bit and x86bit?? please help me... thx...
-
I'm afraid my SO added a keylogger to my laptop
He's a repair tech, and I have a weird feeling. Can someone help? I saw that Linc Davis had given instructions for Terminal and here's what I had for each input from this thread: I believe that I have a keylogger or some sort of spyware installed on