Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to find opc-request-id for oracle cloud request?

User_ZG6NASep 1 2021

Hello,
I'm currently developing an application that uses oracle cloud to make request which then makes changes on a user's oracle cloud account.
Right now I'm following this example:
CreateSnapshotExample.java
https://docs.oracle.com/en-us/iaas/tools/java-sdk-examples/2.4.2/filestorage/CreateSnapshotExample.java.html

I have everything else I need, except where it asks for opcrequestid. I've tried searching online and on oracle cloud but I can't figure out how to find this or what value to use. All i've found is this is given in the response for the call, however in that above example they use it before they get a response.

Comments

843804
well, of course
843804
Hi hpsmartyz

I couldnt get that response
Can you send me some example code

Regards
Sharmila
camickr
import java.awt.*;
import java.beans.*;
import java.awt.event.*;
import javax.swing.*;

public class SplitPaneResizing extends JFrame implements PropertyChangeListener
{
	JSplitPane left;
	JSplitPane right;

	public SplitPaneResizing()
	{
		JSplitPane main = new JSplitPane();
		getContentPane().add( main );
		left = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
		right = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
		main.setLeftComponent( left );
		main.setRightComponent( right );
//
		left.setTopComponent( createPanel(Color.RED) );
		left.setBottomComponent( createPanel(Color.GREEN) );
		right.setTopComponent( createPanel(Color.BLUE) );
		right.setBottomComponent( createPanel(Color.WHITE) );
//
		left.addPropertyChangeListener( this );
		right.addPropertyChangeListener( this );
	}

	private JPanel createPanel(Color background)
	{
		JPanel panel = new JPanel();
		panel.setPreferredSize( new Dimension(200, 100) );
		panel.setBackground( background );
		return panel;
	}

	public void propertyChange(PropertyChangeEvent e)
	{
		if ("dividerLocation".equals(e.getPropertyName()))
		{
			Object source = e.getSource();
			JSplitPane target = (source.equals(left)) ? right : left;
			int location = ((Integer)e.getNewValue()).intValue();

			if (location != target.getDividerLocation())
				target.setDividerLocation( location );
		}
	}

	public static void main(String[] args)
	{
		SplitPaneResizing frame = new SplitPaneResizing();
		frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
		frame.pack();
		frame.setLocationRelativeTo( null );
		frame.setVisible(true);
	}
}
843804
Hi Camickr

That was great help.
But can u help me in avoiding teat flickering that happens when I drag the horizontal divider ,which I havent observed while dragging the vertical divider.

Thank In Advance
Sharmila

camickr
I don't see any flicker with my example.

I have no idea what kind of components you have on your panels (I'm not a mind reader) so the only suggestion is to use the following method on your left/right splitPanes.:

setContinuousLayout(false);


843804
Hi Camickr

Sorry , If I have explained the issue in another sense.
In SplitPaneResizing.java,we have explicitly made the dividers of the two SpliPanes (left and right) to map each other with respect to any change of the the other.

Due to this explict mapping we can find a little variation between the dividers of left and right dividers

hope you can help me out.

Regards
Sharmila
camickr
Addition to my code in reply 3. If you want continuous update of the divider location then you can use:
left.setContinuousLayout(true);
right.setContinuousLayout(true);
1 - 7

Post Details

Added on Sep 1 2021
1 comment
5,419 views