How can this code make a new image appear on each click - Scala -


What am I going to do, click on a button and load a new image in the panel. The image should be draggable and also able to find its position on the screen. I'm not sure how to do this. After this idea, after several clicks I will get many new images which can drag and move forward.

The code looks something like this: -

  val top = new mainframe {// menu = normal button for new button = new button {text = "for image Click ""} Val Panel = New Panel {Override Diff Paint (G: Graphics 2D) {} Suite Toe (Button Mouse. Clicks, Mouse.MewS) Reactions + = {Case buttonclutte (`button`) = & gt; {New ImagePanel {imagePath = ("bottoming.jpg")}} Case: MousePress = & gt; {} Case E: MouseDrag Ged = & gt; {} Case E: Mouse Relapse = & gt; {}}} Import BorderPanel.Position._contents = new borderpanel {layout = = new label ("label") - & gt; Answer Layout + = Panel - & gt; Center Layout + = Button - & gt; West}}  


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -