Page 1 of 2 12 LastLast
Results 1 to 20 of 23
Like Tree1Likes

Thread: JTextField Disappearing

  1. #1
    DinnerFork is offline Member
    Join Date
    Feb 2012
    Posts
    20
    Rep Power
    0

    Default JTextField Disappearing

    I have been having and issue with a JTextField where it is removed from my JPanel after I remove another panel from my JFrame and re-add the panel containing the JTextField. I checked the components of my Jpanel using:

    Java Code:
    Component[] components = matchingWordPanel.getComponents();
    for(int y = 0; y < components.length; y++){
         System.out.println("Panel: " + components[y]);
    }
    It shows that my JTextField is missing despite the fact that I don't have anything removing components from my panel while my JLabel remains in the panel.
    In addition, I tried adding a JPanel in the place of my JTextField and it was not removed.

    What would cause my JTextField to go missing?
    Last edited by DinnerFork; 02-11-2012 at 11:11 PM.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,397
    Rep Power
    25

    Default Re: JTextField Disappearing

    What would cause my JTextField to go missing?
    Probably many different ways to do it.
    What way have you chosen?
    Hard to tell without seeing the code.
    DarrylBurke likes this.

  3. #3
    DinnerFork is offline Member
    Join Date
    Feb 2012
    Posts
    20
    Rep Power
    0

    Default Re: JTextField Disappearing

    What way have you chosen?
    Do you mean how I am removing the panel?
    If that is the case, it should never be removed from the panel. It just seems to be removed right as I swap panels when the "exitImage" button is clicked.

    Here is a somewhat condensed version of the function:
    Java Code:
    	public void editVocab(JPanel mainPanel, JTextField vocabName, JTextField matchingWord, JEditorPane vocabDefinition,
    			JEditorPane vocabSynonyms, ActionListener ACL, ImageIcon vocabIcon){
    		
    		mainPanel.removeAll();
    		
    		//Container for everything that goes inside mainpanel.
    		editPanel = new JPanel(){
    		protected void paintComponent(Graphics g)
    			{
    			Dimension d = getSize();
    				g.drawImage(new ImageIcon("C:\\Program Files\\LangPrac\\BlueMoon.jpg").getImage(), 0, 0, d.width, d.height, null);
    			
    			super.paintComponent(g);
    			}
    		};
    		
    		JLabel vocabNameLabel = new JLabel("Vocabulary Name");
    		JLabel matchingWordLabel = new JLabel("Matching Word");
    		
    		JPanel vocabNamePanel = new JPanel();//Contains Vocabulary Name JLabel & JTextField
    		final JPanel matchingWordPanel = new JPanel();//Contains Matching Word JLabel & JTextField
    		
    		//Test panel to see if it gets removed
    		//JPanel matchingWordContainer = new JPanel();
    		//matchingWordContainer.setOpaque(false);
    		//matchingWordContainer.add(matchingWord);
    		//matchingWordContainer.setPreferredSize(new Dimension(210, 20));
    								
    		ActionListener getImageListener = new ActionListener(){
    			public void actionPerformed(ActionEvent event){
    				
    				//Testing to see if the component is removed.
    				Component[] components = matchingWordPanel.getComponents();
    				
    				for(int y = 0; y < components.length; y++){
    					System.out.println("Panel: " + components[y]);
    				}
    				
    				String source = event.getActionCommand();
    				
    				if(source.equals("getImage")){
    					tempPanel.setVisible(false);
    					tempPanel.removeAll();
    					getVocabImage.setOriginalImage(getImageIcon);
    					tempPanel.add(getVocabImage.getPanel());
    					tempPanel.invalidate();
    					tempPanel.validate();
    					getVocabImage.getPanel().setVisible(true);
    					tempPanel.setVisible(true);
    				}
    				else if(source.equals("exitImage")){
    
    					
    					tempPanel.setVisible(false);
    					tempPanel.removeAll();
    					tempPanel.add(tempEditPanel);
    					changeImage = getVocabImage.changeImage();
    					if(changeImage){
    						getImageIcon = getVocabImage.getNewImage();
    						setupVocabIcon();
    						getVocabImage.setOriginalImage(getImageIcon);
    					}
    					tempPanel.invalidate();
    					tempPanel.repaint();
    					tempPanel.validate();
    					tempPanel.setVisible(true);
    				}
    			}
    		};
    
    		vocabName.setOpaque(false);
    		matchingWord.setOpaque(false);
    
    		vocabName.setPreferredSize(new Dimension(210, 20));
    		matchingWord.setPreferredSize(new Dimension(210, 20));
    		
    
    		vocabName.setBackground(new Color(1).RED);
    		matchingWord.setBackground(new Color(1).WHITE);
    		
    		vocabName.setForeground(new Color(1).WHITE);
    		matchingWord.setForeground(new Color(1).WHITE);
    		
    		vocabNameLabel.setForeground(new Color(1).WHITE);
    		matchingWordLabel.setForeground(new Color(1).WHITE);
    		
    		vocabNamePanel.add(vocabNameLabel);
    		vocabNamePanel.add(vocabName);
    		matchingWordPanel.add(matchingWord);
    		matchingWordPanel.add(matchingWordLabel);
    		
    		
    		vocabNamePanel.setLayout(new FlowLayout());
    		matchingWordPanel.setLayout(new FlowLayout());
    		
    		editPanel.add(vocabNamePanel);
    		editPanel.add(matchingWordPanel);
    		
    		vocabNamePanel.setOpaque(false);
    		matchingWordPanel.setOpaque(false);
    		
    		editPanel.setLayout(new FlowLayout(1, 0, 15));
    		//editPanel.setLayout(new GridLayout(0,1));
    		
    		mainPanel.add(editPanel);
    		mainPanel.setVisible(false);
    		mainPanel.invalidate();
    		mainPanel.repaint();
    		mainPanel.validate();
    		mainPanel.setVisible(true);
    	}

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,397
    Rep Power
    25

    Default Re: JTextField Disappearing

    You need to post a small, complete program that compiles, executes and shows the problem(SSCCE).

  5. #5
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,236
    Rep Power
    7

    Default Re: JTextField Disappearing


  6. #6
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,235
    Rep Power
    19

    Default Re: JTextField Disappearing

    Moved from 'New to Java'

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  7. #7
    DinnerFork is offline Member
    Join Date
    Feb 2012
    Posts
    20
    Rep Power
    0

    Default Re: JTextField Disappearing

    Here is a smaller working version of the original. Every time I try to use the add new vocab function twice, my matchingWord and vocabName JTextFields still disappear. I noticed that this doesn't occur if I run a new instance of GVI though.

    I will also try using the cardlayout to see if it prevents the issue.
    Attached Files Attached Files

  8. #8
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,397
    Rep Power
    25

    Default Re: JTextField Disappearing

    this doesn't occur if I run a new instance of GVI
    Have you solved your problem now?

  9. #9
    DinnerFork is offline Member
    Join Date
    Feb 2012
    Posts
    20
    Rep Power
    0

    Default Re: JTextField Disappearing

    Have you solved your problem now?
    I haven't yet. It was just something I noticed while testing the smaller program, but not a solution I could use.

  10. #10
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,397
    Rep Power
    25

    Default Re: JTextField Disappearing

    Please post a simple single program that compiles, executes and shows your problem.
    When I compile and execute your code I get a blank screen. I'd rather work with one file, not three.

  11. #11
    DinnerFork is offline Member
    Join Date
    Feb 2012
    Posts
    20
    Rep Power
    0

    Default Re: JTextField Disappearing

    Here is a single program version. I didn't get a blank screen issue before, but I tried some changes to prevent it.
    Attached Files Attached Files

  12. #12
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,397
    Rep Power
    25

    Default Re: JTextField Disappearing

    Here's the code so we can discuss it.
    Java Code:
    import java.awt.ComponentOrientation;
    import java.awt.Dimension;
    import java.awt.FlowLayout;
    import java.awt.GridLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.io.File;
    
    import javax.swing.Icon;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTextField;
    
    
    public class TestRun implements ActionListener{
    
    	private JTextField matchingWord;
    	private JTextField vocabName;
    
    	private JPanel splitPane;
    	private JPanel addPanel;
    	private JPanel mainPanel;
    	private JPanel getVocabularyPanel;
    
    	private JButton[] buttons;
    	
    	private File[] allFiles;
    	
    	private Icon[] fileIcons;
    	
    	private JScrollPane scroll;
    	
    	private JPanel[] panels;
    	private JPanel container;
    	private JPanel currentVocabImage;
    	private JPanel menuContainer;
    	
    	private JLabel[] labels;
    
    	private JButton exitButton;
    
    	private boolean boolListenerSet;
    	private final static String workDir = System.getProperty("user.dir");
    	
    	private JButton acceptButton;
    
    	private JPanel editPanel;
    	private boolean firstRun;
    	private JFrame mainFrame;
    	
    	
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    	public TestRun(){
    		mainFrame = new JFrame();
    		vocabName = new JTextField("");
    		matchingWord = new JTextField("");
    		mainPanel = new JPanel();
    		mainPanel.setOpaque(false);
    	}
    
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    	public JPanel setupMainMenu(){	
    		JButton addVocabButton = new JButton("Add new Vocab Word");
    
    		firstRun = true;
    		
    		addPanel = new JPanel();
    		
    		splitPane = new JPanel();
    		splitPane.add(addPanel);
    		splitPane.setOpaque(false);
    		
    		addVocabButton.setActionCommand("addVocab");
    		addVocabButton.addActionListener(this);
    		
    		splitPane.setOpaque(false);
    		
    		addPanel.add(addVocabButton);
    		
    		mainPanel.add(addPanel);
    		mainPanel.setLayout(new GridLayout(0,1));
    		mainPanel.setVisible(true);
    		mainFrame.add(mainPanel);
    		mainFrame.setPreferredSize(new Dimension(700,700));
    		mainFrame.pack();
    		mainFrame.setDefaultCloseOperation(new JFrame().EXIT_ON_CLOSE);
    		mainFrame.setVisible(true);
    		
    		return mainPanel;
    	}
    
    
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    	
    	public void newVocab(){
    		setupEditVocabularyMenu(mainPanel, vocabName, matchingWord, this);
    	}
    
    
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    	public void mainMenu(){
    		mainPanel.removeAll();
    		mainPanel.setVisible(false);
    		mainPanel.add(addPanel);
    		mainPanel.invalidate();
    		mainPanel.repaint();
    		mainPanel.validate();
    		mainPanel.setVisible(true);
    	}
    
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    	public void actionPerformed(ActionEvent event) {
    		String source = event.getActionCommand();
    		
    		if(source.equals("acceptVocab")){
    			mainMenu();
    		}
    		
    		else if(source.equals("addVocab")){
    			vocabName.setText("");
    			matchingWord.setText("");
    			newVocab();
    		}
    	}
    	
    	public static void main(String args[]){
    	
    		TestRun main = new TestRun();
    		main.setupMainMenu();
    	}
    	
    	public void setupGetVocabularyPanel(){
    		getVocabularyPanel = new JPanel();
    		currentVocabImage = new JPanel();
    		menuContainer = new JPanel();
    		
    		currentVocabImage = new JPanel();
    		currentVocabImage.setPreferredSize(new Dimension(400,100));
    		getVocabularyPanel.setPreferredSize(new Dimension(500, 400));
    		getVocabularyPanel.setLayout(new GridLayout());
    		getVocabularyPanel.setOpaque(false);
    
    		
    		getFileNames();
    	    displayFiles();
    	    
    	    getVocabularyPanel.setVisible(true);
    	}
    	
    	public void getFileNames(){
    		
    		 File[] listOfFiles = new File(workDir).listFiles();
    
    		 allFiles = listOfFiles;
    		 try{
    			 fileIcons = new Icon[listOfFiles.length];
    		 }catch(NullPointerException NPE){System.out.println("No Image Files in directory. (GetVocabImage)");}
    	}
    
    	public void displayFiles(){
    		
    		if(fileIcons == null){
    			fileIcons = new Icon[0];
    		}
    		
    		getVocabularyPanel.setLayout(new GridLayout());
    		
    		panels = new JPanel[fileIcons.length];//Container for buttons and labels
    		container = new JPanel();//Container for panels
    		
    		buttons = new JButton[fileIcons.length];//Displays the images
    		
    		labels = new JLabel[fileIcons.length];//Displays the image names
    		
    		boolListenerSet = false;//Is the action listenr for exitButton set?
    		exitButton = new JButton("Exit");//Previous Menu
    		exitButton.setActionCommand("exitImage");
    		exitButton.setPreferredSize(new Dimension(130, 35));
    		
    		JPanel exitPanel = new JPanel();
    		exitPanel.add(exitButton);
    		exitPanel.setPreferredSize(new Dimension(150, 40));
    		exitPanel.setLayout(new FlowLayout());
    		exitPanel.setOpaque(false);
    		
    		String extension = " ";//Extension of file
    
    		container = new JPanel();
    		
    		menuContainer.setOpaque(false);
    		menuContainer.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
    		menuContainer.setPreferredSize(new Dimension(300,600));
    		menuContainer.setOpaque(false);
    		
    		container.setLayout(new GridLayout(4,0,30,5));
    		container.setOpaque(false);
    		container.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
    		container.setPreferredSize(new Dimension((int)37.5 * panels.length, 600));
    				
    		scroll = new JScrollPane();//(Holds buttons and labels container);
    		scroll.setPreferredSize(new Dimension(300,600));
    		scroll.getViewport().setPreferredSize(new Dimension(100,100));
    		scroll.getViewport().setOpaque(false);
    		scroll.getViewport().add(container);
    		scroll.setOpaque(false);
    		getVocabularyPanel.add(scroll);
    
    
    		menuContainer.add(exitPanel);
    		getVocabularyPanel.add(menuContainer);
    		
    		getVocabularyPanel.setLayout(new GridLayout());
    		getVocabularyPanel.setOpaque(false);
    				
    		//Add the panels to the file menu
    		for(int x = 0; x < fileIcons.length ; x++){
    			extension = getExt(x);
    			if(extension.equalsIgnoreCase("JPEG Image") || extension.equalsIgnoreCase("Bitmap Image")
    					|| extension.equalsIgnoreCase("IrfanView JPG File") || extension.equalsIgnoreCase("JPG File"))
    			{	
    				panels[x] = new JPanel();
    				panels[x].setPreferredSize(new Dimension(150,160));
    				panels[x].setOpaque(false);
    				container.add(panels[x]);
    			}
    		}
    		
    		//Add buttons and labels to panels
    		for(int x = 0; x < fileIcons.length ; x++){
    			labels[x] = new JLabel();
    			extension = getExt(x);
    			buttons[x] = new JButton();
    			
    			if(extension.equalsIgnoreCase("JPEG Image") || extension.equalsIgnoreCase("Bitmap Image")
    					|| extension.equalsIgnoreCase("IrfanView JPG File") || extension.equalsIgnoreCase("JPG File"))
    			{
    				buttons[x] = new JButton("");
    				buttons[x].setText("activated");
    				buttons[x].setPreferredSize(new Dimension(150,120));
    				buttons[x].setActionCommand(Integer.toString(x));
    				labels[x].setPreferredSize(new Dimension(150,40));
    
    				panels[x].add(buttons[x]);
    				panels[x].add(labels[x]);
    				panels[x].setLayout(new FlowLayout());
    				panels[x].repaint();
    				
    				container.repaint();
    			}
    			
    			buttons[x].setActionCommand(Integer.toString(x));
    			labels[x].setText(allFiles[x].getName());
    		}
    	}
    	
    	//Get file extension
    	public String getExt(int index){
    		javax.swing.JFileChooser fc = new javax.swing.JFileChooser();
    		String filetype = fc.getTypeDescription(new java.io.File(allFiles[index].getPath()));
    		return filetype;
    	}
    	
    	public void setExitButtonListener(ActionListener getACL){
    		if(!boolListenerSet){
    			exitButton.addActionListener(getACL);
    			boolListenerSet = true;
    		}
    	}
    	
    	public JPanel getVocabularyPanel(){
    		return getVocabularyPanel;
    	}
    
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    	public void refreshVocabularyPanel(){
    		getVocabularyPanel.setVisible(false);
    		getVocabularyPanel.invalidate();
    		getVocabularyPanel.repaint();
    		getVocabularyPanel.validate();
    		getVocabularyPanel.setLayout(new GridLayout());
    		getVocabularyPanel.setVisible(true);
    	}
    	
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    public void setupEditVocabularyMenu(JPanel mainPanel, JTextField vocabName, JTextField matchingWord, ActionListener ACL){
    		
    		mainPanel.removeAll();
    		
    		editPanel = new JPanel();
    		
    		JLabel vocabNameLabel = new JLabel("Vocabulary Name");
    		
    		JLabel matchingWordLabel = new JLabel("Matching Word");
    		
    		JPanel vocabNamePanel = new JPanel();
    		JPanel matchingWordPanel = new JPanel();
    		JPanel getImagePanel = new JPanel();
    		JPanel acceptCancelPanel = new JPanel();
    		JPanel imageContainer = new JPanel();
    		
    		final JPanel tempEditPanel = editPanel;
    		final JPanel tempPanel = mainPanel;
    		
    		JButton getImageButton = new JButton("Change Image");
    		
    
    		imageContainer.setOpaque(false);
    		imageContainer.setPreferredSize(new Dimension(450, 80));
    		imageContainer.setLayout(new GridLayout(1, 2));
    		imageContainer.add(getImagePanel);
    		
    		getImagePanel.add(getImageButton);
    		getImagePanel.setOpaque(false);
    								
    		ActionListener getImageListener = new ActionListener(){
    			public void actionPerformed(ActionEvent event){
    				
    				String source = event.getActionCommand();
    				
    				if(source.equals("getImage")){
    					tempPanel.setVisible(false);
    					tempPanel.removeAll();
    					tempPanel.add(getVocabularyPanel());
    					tempPanel.invalidate();
    					tempPanel.validate();
    					getVocabularyPanel().setVisible(true);
    					tempPanel.setVisible(true);
    				}
    				else if(source.equals("exitImage")){
    
    					
    					tempPanel.setVisible(false);
    					tempPanel.removeAll();
    					tempPanel.add(tempEditPanel);
    					tempPanel.invalidate();
    					tempPanel.repaint();
    					tempPanel.validate();
    					tempPanel.setVisible(true);
    				}
    			}
    		};
    		
    		if(firstRun){
    			setupGetVocabularyPanel();
    			firstRun = false;
    		}
    		setExitButtonListener(getImageListener);
    		
    		getImageButton.addActionListener(getImageListener);
    		getImageButton.setActionCommand("getImage");
    	
    		vocabName.setOpaque(false);
    		matchingWord.setOpaque(false);
    		
    		acceptButton = new JButton("Accept");
    		acceptButton.setPreferredSize(new Dimension(180, 30));
    		acceptButton.addActionListener(ACL);
    		acceptButton.setActionCommand("acceptVocab");
    
    		vocabName.setPreferredSize(new Dimension(210, 20));
    		matchingWord.setPreferredSize(new Dimension(210, 20));
    		acceptCancelPanel.setPreferredSize(new Dimension(450, 40));
    		
    		acceptCancelPanel.add(acceptButton);
    		vocabNamePanel.add(vocabNameLabel);
    		vocabNamePanel.add(vocabName);
    		matchingWordPanel.add(matchingWordLabel);
    		matchingWordPanel.add(matchingWord);
    		
    		
    		vocabNamePanel.setLayout(new FlowLayout());
    		matchingWordPanel.setLayout(new FlowLayout());
    		acceptCancelPanel.setLayout(new FlowLayout());
    		
    		editPanel.add(vocabNamePanel);
    		editPanel.add(matchingWordPanel);
    		editPanel.add(imageContainer);
    		editPanel.add(acceptCancelPanel);
    		
    		vocabNamePanel.setOpaque(false);
    		matchingWordPanel.setOpaque(false);
    		editPanel.setOpaque(false);
    		
    		editPanel.setLayout(new FlowLayout(1, 0, 15));
    		
    		mainPanel.add(editPanel);
    		mainPanel.setVisible(false);
    		mainPanel.invalidate();
    		mainPanel.repaint();
    		mainPanel.validate();
    		mainPanel.setVisible(true);
    	}
    }

  13. #13
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,397
    Rep Power
    25

    Default Re: JTextField Disappearing

    The first thing I see is that your code is not a small simple program. 400 lines is past being small.

    What is supposed to happen when this code is executed?
    Last edited by Norm; 02-12-2012 at 08:21 PM.

  14. #14
    DinnerFork is offline Member
    Join Date
    Feb 2012
    Posts
    20
    Rep Power
    0

    Default Re: JTextField Disappearing

    Well, you should be able to add a new vocabulary word, enter a name and matching word, enter the change image menu, exit the menu, and accept the changes. It works fine the first time around, but after repeating the same step it leads to the JTextFields for vocabName and matchingWord being removed from the panel upon exiting the change image menu.

    I've been using this to check to see if the panel was there or not:

    Java Code:
    Component[] components = matchingWordPanel.getComponents();				
    for(int y = 0; y < components.length; y++){
        System.out.println("Panel: " + components[y]);

  15. #15
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,397
    Rep Power
    25

    Default Re: JTextField Disappearing

    Try making a small simpler program that shows your problem. This one is too big and hangs when I try to execute it.
    There is too much not related to the GUI to wade through. Strip it down to a GUI only, minimum components and no files.

  16. #16
    DinnerFork is offline Member
    Join Date
    Feb 2012
    Posts
    20
    Rep Power
    0

    Default Re: JTextField Disappearing

    I remove some of the other parts.
    Attached Files Attached Files

  17. #17
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,397
    Rep Power
    25

    Default Re: JTextField Disappearing

    What is the code supposed to do?
    How can I see what the problem is?

  18. #18
    DinnerFork is offline Member
    Join Date
    Feb 2012
    Posts
    20
    Rep Power
    0

    Default Re: JTextField Disappearing

    It is supposed to let you set a matching word, vocabulary name, and image for any number of vocabulary words.
    It should let you run enter the add new vocabulary menu, the change image menu, exit that menu, and accept to get back to the start. However, anytime you repeat it will remove the JTextFields when exiting the change image menu.

  19. #19
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,397
    Rep Power
    25

    Default Re: JTextField Disappearing

    Have two reference variables for the panels makes for confusion!!!

  20. #20
    DinnerFork is offline Member
    Join Date
    Feb 2012
    Posts
    20
    Rep Power
    0

    Default Re: JTextField Disappearing

    Quote Originally Posted by Norm View Post
    Have two reference variables for the panels makes for confusion!!!
    The tempEditPanel, editPanel and mainPanel, tempPanel?

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 3
    Last Post: 11-14-2011, 05:13 AM
  2. Why is javaw.exe Randomly Disappearing
    By Land Of Java in forum JavaFX
    Replies: 0
    Last Post: 10-05-2011, 08:43 PM
  3. Replies: 0
    Last Post: 08-30-2011, 09:18 AM
  4. Replies: 1
    Last Post: 01-30-2009, 06:44 PM
  5. JtextField
    By kashifu in forum Advanced Java
    Replies: 2
    Last Post: 06-27-2008, 04:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •