首页 程序员大本营 98sky.com 程序员问答大本营 98sky.com.
Home Php C# Sql C C++ Javascript Python Java Go Android Git Linux Asp.net Django .net Node.js Ios Xcode Cocoa Iphone Mysql Tomcat Mongodb Bash Objective-c Scala Visual-studio Apache Elasticsearch Jar Eclipse Jquery Ruby-on-rails Ruby Rubygems Android-studio Spring Lua Sqlite Emacs Ubuntu Perl Docker Swift Amazon-web-services Svn Html Ajax Xml Java-ee Maven Intellij-idea Rvm Macos Unix Css Ipad Postgresql Css3 Json Windows-server Vue.js Typescript Oracle Hibernate Internet-explorer Github Tensorflow Laravel Symfony Redis Html5 Google-app-engine Nginx Firefox Sqlalchemy Lucene Erlang Flask Vim Solr Webview Facebook Zend-framework Virtualenv Nosql Ide Twitter Safari Flutter Bundle Phonegap Centos Sphinx Actionscript Tornado Register | Login | Edit Tags | New Questions | 繁体 | 简体


5 questions online user: 27

0
votes
answers
8 views
+10

jquery移動更改複選框顏色

0

當選中其他顏色時,如何更改複選框顏色(藍色)和複選框圖標顏色(白色)。jquery移動更改複選框顏色

<link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" /> 
 
    <script src="https://code.jquery.com/jquery-1.11.1.min.js"></script> 
 
    <script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script> 
 

 
    <form> 
 
     <label> 
 
      <input type="checkbox" name="checkbox-0 ">Check me 
 
     </label> 
 
    </form>

+0

雖然改變背景顏色是微不足道的CSS,爲圖標的顏色有兩種顏色集:*白色*和*黑*。您可以通過應用「ui-alt-icon」類來顯示*黑色*圖標。您無法着色圖標,因爲圖標圖像未內聯。以下是替代圖標集的參考資料:http://demos.jquerymobile.com/1.4.5/icons/ – deblocker

0
votes
answers
12 views
+10

在javafx/scenebuilder文本字段或標籤中的mysql數據

0

有沒有辦法從mysql數據庫獲取數據並在javafx/scenebuilder中的文本字段中顯示部分數據?在javafx/scenebuilder文本字段或標籤中的mysql數據

我試圖在fxmlcontroller如下:

@Override 
public void initialize(URL url, ResourceBundle rb) { 


    try { 
     // Connection to the database 
     Connection myConn = DriverManager.getConnection("jdbc:mysql://localhost:3306/demo", "root", "root"); 

     // Statement 
     Statement myStmt = myConn.createStatement(); 
     // SQL query 
     ResultSet myRs = myStmt.executeQuery("select * from test"); 
     // Result processing 
     while (myRs.next()) { 
      // testing if it gets the data from the db 
      System.out.println(myRs.getString("firstname")); 
      System.out.println(myRs.getString("lastname")); 

      // attempt to put it in a textfield 
      Labelnummer.setText(myRs.getString("firstname")); 
      Tijd.setText(myRs.getString("lastname")); 
     } 



    } catch (Exception exc) { 
     exc.printStackTrace(); 
    } 

結果是一個NullPointerException

我覺得我得到的連接和獲得通過系統打印的數據統計出來,只是沒有辦法的辦法,以把它的數據放到一個文本框或標籤中。

的fxid的是在.fxml

我想我失去了一些東西是正確的,我只是不知道是什麼。

預先感謝您!

編輯:繼承人的堆棧跟蹤:

java.lang.NullPointerException 
at com.mycompany.fastenyourseatbelts.DetailPaginaFXMLDocumentController.initialize(DetailPaginaFXMLDocumentController.java:98) 
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2548) 
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441) 
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3214) 
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3175) 
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3148) 
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3124) 
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3104) 
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:3097) 
at com.mycompany.fastenyourseatbelts.FXMLController.Detail(FXMLController.java:27) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at java.lang.reflect.Method.invoke(Method.java:498) 
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71) 
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at java.lang.reflect.Method.invoke(Method.java:498) 
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275) 
at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1769) 
at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1657) 
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:8413) 
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:381) 
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:295) 
at java.security.AccessController.doPrivileged(Native Method) 
at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$354(GlassViewEventHandler.java:417) 
at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389) 
at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:416) 
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(Thread.java:748) 

這行是我試圖使文本框獲取數據:

// attempt to put it in a textfield 
     Labelnummer.setText(myRs.getString("firstname")); 

繼承人的方法來展現的舞臺和負載在FXML:

public class DetailPagina extends Application { 

@Override 
public void start(Stage stage) throws Exception { 
    Parent root = FXMLLoader.load(getClass().getResource("DetailPaginaFXMLDocument.fxml")); 

    Scene scene = new Scene(root); 
    scene.getStylesheets().add("/styles/Style.css"); 

    stage.setScene(scene); 
    stage.show(); 
} 


public static void main(String[] args) { 
    launch(args); 
} 

}

+2

您是否在控制器中使用@FXML註釋Labelnummer和Tijd? – Hassan

+0

是的,他們都用@FXML註釋。 – LmaoBobobo

+0

您可以顯示加載XML文件並設置舞臺的方法代碼嗎? – Hassan

0
votes
answers
16 views
+10

DISPLAY:0如果在每個碼頭集裝箱內運行Xvfb:0,則由多個碼頭集裝箱共享?

2

我需要在多個Docker容器中運行相同的一組進程,並且每個容器處理一個日誌。我需要屏蔽每個容器的結果。如果我在每個容器中運行Xvfb:0,它們是否都共享主機的Display:0或每個使用它自己的Display:0?如果我將每個容器中的ffmpeg運行到屏幕截圖顯示:0,它會得到它運行的當前容器的獨立視圖還是全局顯示:0?我的問題是如果這個顯示:0是共享的,如果Xvfb:0在每個容器內開始。DISPLAY:0如果在每個碼頭集裝箱內運行Xvfb:0,則由多個碼頭集裝箱共享?

0
votes
answers
26 views
+10

PySpark:數據幀 - 轉換結構數組

0

我有以下結構的數據幀:PySpark:數據幀 - 轉換結構數組

root 
|-- index: long (nullable = true) 
|-- text: string (nullable = true) 
|-- topicDistribution: struct (nullable = true) 
| |-- type: long (nullable = true) 
| |-- values: array (nullable = true) 
| | |-- element: double (containsNull = true) 
|-- wiki_index: string (nullable = true) 

我需要將其更改爲:

root 
|-- index: long (nullable = true) 
|-- text: string (nullable = true) 
|-- topicDistribution: array (nullable = true) 
| |-- element: double (containsNull = true) 
|-- wiki_index: string (nullable = true) 

請問我該怎麼辦呢?

非常感謝。

0
votes
answers
11 views
+10

如何在python help()內置的函數結果中搜索一些單詞?

1

有時候我需要搜索一些我已經安裝的python庫文檔裏面的東西,而且我總是使用help()內置函數,但是我想知道是否有某種方法可以在這個內容中進行搜索,甚至更好,而不需要打開一個python終端。我真的很想知道一些乾淨的方法來做到這一點(基於Linux),避免管道或類似的東西,我已經知道。有一些圖書館或外部有用的與我們分享?如何在python help()內置的函數結果中搜索一些單詞?

+0

你想一個方法來搜索所有的文檔字符串中一氣呵成,或您指定類或方法僅僅是文檔字符串? – tripleee

+0

至少我可以在解釋器中使用help()獲得相同的信息。謝謝。 –