Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8854683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:56:26+00:00 2026-06-14T13:56:26+00:00

How I can create window all content of which is an animation produced with

  • 0

How I can create window all content of which is an animation produced with png sequence?

I can’t find any appropriate articles for this theme. Or if I plan to do little game in Clojure, maybe it wood be better to use any java game engine? What will you use for this aim?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T13:56:27+00:00Added an answer on June 14, 2026 at 1:56 pm

    Let’s adapt an example from Wikibooks.

    (import '(javax.swing JFrame JPanel)
            '(java.awt Dimension Toolkit)
            '(java.net URL))
    
    (def url
      (URL. "http://www.gravatar.com/avatar/70fa7ca20ce9cbf4c97bb9538034cef7?s=200&d=identicon&r=PG"))
    
    (def avatar
      (ref (-> (Toolkit/getDefaultToolkit) (.getImage url))))
    
    (defn image
      []
      @avatar)
    
    (defn make-panel []
      (let [panel (proxy [JPanel] []
                    (paintComponent [g]
                      (.drawImage g (image) 0 0 this)))]
        (doto panel
          (.setPreferredSize (Dimension. 200 200)))))
    
    (defn make-frame [panel]
      (doto (new JFrame)
        (.add panel)
        .pack
        .show))
    
    (def frame
      (make-frame (make-panel)))
    

    Now update the avatar ref to a new image using ref-set. Remember to repaint the frame afterwards.

    (dosync
      (ref-set avatar (-> (Toolkit/getDefaultToolkit) (.getImage "image.png"))))
    
    (.repaint frame)
    

    Now let’s animate it.

    (def images
      (cycle (map #(-> (Toolkit/getDefaultToolkit) (.getImage %))
                  ["1.png" "2.png" "3.png"])))
    
    (loop [coll images]
      (when (.isVisible frame)
        (dosync (ref-set avatar (first coll)))
        (.repaint frame)
        (Thread/sleep 100)
        (recur (rest coll))))
    

    I hope it’s enought to get you started.

    Speaking of game engines for the Java ecosystem, you might want to take a look at lwjgl.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a console application from which I create a window. I can render
Is there any tools using which I can use to create Windows forms from
How i can find all the windows created by a particular process using c#?
For Android GUI: I would like to create a window that I can pull
I'm using CreateWindowEx() function to create an EDIT window, i.e. where a user can
I'm trying to create an always-op-top button/clickable-image which stays on top of all the
I'll try to put this as clearly as I can, but I'm all too
Is there any recommended way with WPF to create a common window style to
how can create a windows move maker like application in vb.net.... if we want
In Delphi you can create a standalone Windows VCL Forms application. You can also

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.