Java SWT dispose() and anonymous instantiation | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

Java SWT dispose() and anonymous instantiation

I've made a mistake of trying to learn SWT and run into a question I can't seem to find an answer to. I've read many times that you should dispose() of any object as soon as you don't need it. What happens when you don't do that and does that mean you can't anonymously instantiate? By anonymous instantiation I mean something like label.setBackground(new Color(...));

26th Jan 2018, 7:02 PM
BlazingMagpie
BlazingMagpie - avatar
1 ответ
0
Thank you for the answers. Apparently, I simply can't use anonymous instantiation with SWT colors and fonts. Guess I'll have to make a cache to handle colors
31st Jan 2018, 3:29 AM
BlazingMagpie
BlazingMagpie - avatar