- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
[Swing] Question related to implicit
Hi all,
I want to specify the size of a component like this:
preferredSize = (300, 300)
but the compiler warns about it being deprecated, and recommends me to use the implicit in Swing object. Now, how do I use it?, because just importing Swing._ doesn't work, I mean, the compiler still assumes I am calling the tuple version instead of the Dimension version using implicits. So how do I use the implicit?, like this maybe?:
preferredSize = (300, 300): Dimension
but that would be almost like
preferredSize = new Dimension(300, 300)
which totally kills the purpose. All help is welcomed :)
Cheers.
I want to specify the size of a component like this:
preferredSize = (300, 300)
but the compiler warns about it being deprecated, and recommends me to use the implicit in Swing object. Now, how do I use it?, because just importing Swing._ doesn't work, I mean, the compiler still assumes I am calling the tuple version instead of the Dimension version using implicits. So how do I use the implicit?, like this maybe?:
preferredSize = (300, 300): Dimension
but that would be almost like
preferredSize = new Dimension(300, 300)
which totally kills the purpose. All help is welcomed :)
Cheers.










Re: [Swing] Question related to implicit
On Thu, Apr 15, 2010 at 10:16 AM, Rodrigo Cano <ioniviil [at] gmail [dot] com> wrote:
Re: [Swing] Question related to implicit
On Thu, Apr 15, 2010 at 4:55 PM, Naftoli Gugenheim <naftoligug [at] gmail [dot] com> wrote: