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 8579627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:38:56+00:00 2026-06-11T20:38:56+00:00

I am currently developing my first bigger Scala Swing project , and I have

  • 0

I am currently developing my first bigger Scala Swing project, and I have written my own component as a part of the tile map editor, in which the user chooses the tiles.

Just as a combo box emits some sort of event when another element is selected, I want this component to do the same, with my own case classes. I have not found any article or tutorial on this topic.

In further notice, how can I also write a component that publishes the events of sub-components. So that it just reaches them through.

  • 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-11T20:38:57+00:00Added an answer on June 11, 2026 at 8:38 pm

    Perhaps look at other projects extending scala-swing. For example there is ScalaSwingContrib; I think looking at the ColorChooser component and the associated ColorChooserEvent is a good starting point, as this is a fairly simple component.

    import javax.{swing => js}
    import js.{event => jse}
    import java.awt.Color
    import scala.swing._
    import event.Event
    
    class ColorChooser(initialColor: Color) extends Component {
      ...
      override lazy val peer: js.JColorChooser = 
        new js.JColorChooser(initialColor) with SuperMixin
    
      peer.getSelectionModel().addChangeListener(new jse.ChangeListener {
        def stateChanged(e: jse.ChangeEvent) {
          publish( new ColorChangeEvent(peer.getColor))
        }
      })
    }
    
    case class ColorChangeEvent(c: Color) extends Event
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently developing a PHP framework and have ran into my first problem. I need
I am currently developing a new website and have problems with IE7. First image
I am currently developing my first iOS app which i have tested on simulator
I am currently developing a private framework for use on WebKit devices. I have
I am developing a project that lately have been taking off with increased popularity.
I'm currently developing my first android app, and my first game. I've been developing
I am currently developing a Facebook App (it's not my first one) and I
I'm currently developing a new web application. This is the first time I'm using
Currently developing my first Native iPhone application, the application is going to be integrating
I am currently developing my first Android application by reading Dev Documentation at Android

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.