Java Code Examples for javax.swing.JComponent.setLocation()

The following are Jave code examples for showing how to use setLocation() of the javax.swing.JComponent class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: Pogamut3   File:   View Source Code Vote up 5 votes
/** when end time is changed, update time axis and if necessary, move
 * viewport at the end.
public void endTimeChanged(long previousEndTime, long endTime) {

    // FIXME: if we are at the end and
    int panelWidth = MVTimelineElement.this.getWidth();
    JComponent view = scene.getView();
    if (view.getWidth() > panelWidth) {
        if (view.getX() + view.getWidth() - panelWidth < 10) {
            view.setLocation(-(view.getWidth() - panelWidth), view.getY());