Re: [Microba-controls] painting the date pickers JFormattedTextField
Brought to you by:
michaelbaranov
From: Michael B. <mic...@gm...> - 2008-11-11 18:14:18
|
Greg, You'll have to dig deeper into the UI delegate of the control and modify the code there. There's no straight answer for this as the DatePicker consists of JFormattedTextField and a JButton. Michael. > Is there any way I can override the paintComponent method or otherwise > paint an image on the JFormattedTextField ? > > I am able to add a mouse listener to the component and I want to pop > up a custom control when the user clicks on the first 20 pixels of the > DatePicker. > > I have this working find and I just need to add an image for those 20 > pixels. Normally I just subclass a component and have > > protected void paintComponent(Graphics g) { > super.paintComponent(g); > Image searchImage = getSearchImage(); > g.drawImage(searchImage, 1, 1, null); > } > > but that doesn't work on the date picker. Or maybe it would work if I > could indent the date picker itself, not just the text. > > Any ideas? > > thanks! > > Greg > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Microba-controls mailing list > Mic...@li... > https://lists.sourceforge.net/lists/listinfo/microba-controls |