Results 1 to 2 of 2
  1. #1
    rdj
    rdj is offline Member
    Join Date
    Jul 2016
    Posts
    4
    Rep Power
    0

    Exclamation ComboBox Problem

    Hi, I am stuck with a problem related to ComboBox I guess,

    Showing Error is :
    Java FX Code:
    Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
    	at UI.ui_RegisterApplicant.lambda$1(ui_RegisterApplicant.java:195)
    	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
    	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
    	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
    	at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
    	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    	at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    	at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
    	at javafx.event.Event.fireEvent(Event.java:198)
    	at javafx.scene.Node.fireEvent(Node.java:8411)
    	at javafx.scene.control.Button.fire(Button.java:185)
    	at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:182)
    	at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(BehaviorSkinBase.java:96)
    	at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(BehaviorSkinBase.java:89)
    	at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
    	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
    	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
    	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
    	at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
    	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    	at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    	at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
    	at javafx.event.Event.fireEvent(Event.java:198)
    	at javafx.scene.Scene$MouseHandler.process(Scene.java:3757)
    	at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3485)
    	at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762)
    	at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2494)
    	at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:380)
    	at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:294)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$354(GlassViewEventHandler.java:416)
    	at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
    	at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:415)
    	at com.sun.glass.ui.View.handleMouseEvent(View.java:555)
    	at com.sun.glass.ui.View.notifyMouse(View.java:937)
    	at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    	at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
    	at java.lang.Thread.run(Unknown Source)
    So I checked my ui_RegisterApplicant.java at line 195 :
    Java FX Code:
    Button_Confirm.setOnAction(e -> {
            	if((Field_Username.getText() == "") && (Field_Password.getText() == "")){
            		alert = new Alert(AlertType.WARNING);
        			alert.setTitle("Information");
        			alert.setHeaderText("Failed !");
        			alert.setContentText("Username & Password fields are blank - Please try again !");
    
        			alert.showAndWait();
            	}else{
            		ApplicantRegProcess(Field_Username.getText().toString(), Field_Password.getText().toString(), false, 
                			Field_First_Name.getText().toString(), Field_Last_Name.getText().toString(), 
                			Combo_Gender.getValue().toString(), Field_Email_Address.getText().toString(), [B][SIZE=3]// this line is 195[/SIZE][/B]
                			Field_Mobile_Number.getText().toString(), Field_Question.getText().toString());
            	}
    
            	Field_Username.clear();
            	Field_Password.clear();
            	Field_First_Name.clear();
            	Field_Last_Name.clear();
            	Combo_Gender.valueProperty().set(null);
            	Field_Email_Address.clear();
            	Field_Mobile_Number.clear();
            	Field_Question.clear();
            });
    I have initialized the ComboBox as :
    Java FX Code:
     ObservableList<String> options = FXCollections.observableArrayList("Male", "Female", "Others");
            ComboBox<String> Combo_Gender = new ComboBox<String>(options);
    Now I cannot understand what is the problem here... If anyone could help me it would be appreciated...
    Thanks In Advance !

  2. #2
    rdj
    rdj is offline Member
    Join Date
    Jul 2016
    Posts
    4
    Rep Power
    0

    Default Re: ComboBox Problem

    Okay I have solved this issue by my self.. Closing this thread .....

Similar Threads

  1. Problem: Fill a comboBox from another combobox
    By Ridha in forum AWT / Swing
    Replies: 2
    Last Post: 03-08-2013, 02:34 PM
  2. Problem with ComboBox in a table
    By xyknight in forum New To Java
    Replies: 8
    Last Post: 04-25-2011, 03:05 AM
  3. Combobox Problem?
    By waqasahmed_03235001393 in forum Advanced Java
    Replies: 1
    Last Post: 07-27-2010, 10:56 AM
  4. problem in combobox
    By 435.mahesh in forum AWT / Swing
    Replies: 3
    Last Post: 05-04-2009, 05:12 AM
  5. Problem in combobox
    By santhosh_el in forum AWT / Swing
    Replies: 4
    Last Post: 04-03-2009, 04:01 AM

Tags for this Thread

Posting Permissions

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