• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Border to JPanel is displacing JPanel which has Video Component

 
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello to all,

Here is my problem and and i'll try to explain it.

My JFrame contains a JPanel to which i have added a Video component( JMF ). Now after some time say 5 minutes i want to set the border of the JPanel to yellow so that it blinks 10 times. I am just using JPanel.setBorder(new LineBorder()) method to specify the width of the border. But the problem is when i add the Border to the JPanel the JPanel gets displaced. To put it this way the border starts at location from where the JPanel initially started. I tried to solve the issue by setting JPanel's location but the location is not changing. Is there any way by which we can change the location of the JPanel from some other code and then calling revalidate or repaint ?

Thanks and Regards
-- Girish --
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can't change the location unless the panel's parent has a null layout,
and if so, adding a wide border you would also need to change the bounds.
Using null layouts often gets messy, and is rarely recommended.

create another program, just frame with panel, add your border blinking code,
but set it to blink immediately.

if this has the same problem, post the code here, so we can see exactly what is happening
reply
    Bookmark Topic Watch Topic
  • New Topic