Background image and JtextField

时间:2015-05-12 23:02:25

标签: java swing jtextfield

I want to set a background image for my // Application route.js var ApplicationRoute = Ember.Route.extend({ model: function() { return Ember.RSVP.hash({ showBackground: false }); }, setupController: function(controller, models) { controller.setProperties(models); }, action: { showBackground: function(){ // This runs fine this.controllerFor('application').set('showBackground', true); }, hideBackground: function(){ // This runs fine this.controllerFor('application').set('showBackground', false); } } }); // Background component.js var BackgroundImage = Ember.Component.extend({ // This never runs for some reason!? controlImage: function(){ if( this.get('showBackground') ) { // Open menu! console.log('show image'); } else { // Close menu! console.log('hide image'); } }.observes('showBackground') }); // Login template.hbs {{background-image showBackground=showBackground}} which contains many JPannel and JTextField (I used JButton), but the the components won't appear unless the mouse passes by. I can't make a g.drawImage() for every component because I have too many of them.

Can anyone please help or point me into the right direction?

1 个答案:

答案 0 :(得分:2)

It sounds like either you've overridden import re m = re.search(".*\) (.*)\[.*\] (.*)","6d) We took no [pains] to hide it .") if m: g = m.groups() print g[0] + g[1] or failed to call paint when painting your image.

Make sure that:

  1. You override super.paintComponent of your paintComponent
  2. You call JPanel before you perform any custom painting

For example

Also take a look at Painting in AWT and Swing and Performing Custom Painting for more details about painting in Swing