Why table's column names are not displayed here?

假装没事ソ 提交于 2019-12-10 14:30:00

问题


I have a problem with seesaw table. When I try to make up and show a simple table, it shows without column names.
What I did:

At first, I must say that I am using [seesaw "1.4.2"].
Then:

;; Clojure 1.4.0
(require '[seesaw.core :as ss])

(ss/native!)

(def main-window
     (-> (ss/frame
           :title "Main window")
       ss/pack!
       (ss/config! :minimum-size [320 :by 240])
       ss/show!))

(def display
     #(ss/config! main-window
                  :content %))

(display
     (ss/table
       :id :dumb-table
       :model [:columns
               [:one :another]
               :rows
               [["1" "2"]
                ["3" "4"]]]))

what I get http://img.leprosorium.com/1663368
Table appears, but without column names, which, I guess, must be "one" and "another". What went wrong here?

It happens also if I use exactly the same code as in official wiki: https://github.com/daveray/seesaw/wiki/Tables

Update:

I forgot to mention, I'm using JDK 1.7u10, maybe it makes sense.


回答1:


I dont know how to use seesaw table. but in general you need to add JTable to JScrollPane. This is because JScrollPane makes column header available at the top even when you scroll the data. if you dont want to use JScrollPane then u need to add the column header manually to the container so they stay at the top. So try adding JScrollPane.

Let me know if i went wrong...:)




回答2:


Well, I think you missed some thing, ( see reference )

(display
 (ss/table
   :id :dumb-table
   :model [:columns
           [{:key :one, :text "One~1"} 
             {:key :one, :text "The Other~2"}]
           :rows
           [["1" "2"]
            ["3" "4"]]]))


来源:https://stackoverflow.com/questions/13997136/why-tables-column-names-are-not-displayed-here

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!