Listening for objects in a Vector changing attributes.
Can anybody help me with this problem?
A Vector has a number of objects contained in it.
How can I determine if any of the contained objects have had thier attribute(s) changed?
Would an ObjectChangeListener be something that I could use on the Vector?
Thanks. Ken
Nothing you do with the Vector will tell you whether the attributes of the objects "in" it have changed. That's because the Vector actually contains references to those objects, and other references to the same objects could change them. So, you would have to provide listeners that listened to the objects for changes. (Of course you could make the Vector one of those listeners, then it could pass on its events to other objects.)
Similar Messages
-
Can you listen for a string value to change?
Is there any easy way to see if a string changes value? I have a public static string in one instance of a class that I wish to be notified when it changes. An object of another class will have the listener.
Edited by: sarcasteak on Dec 8, 2009 1:40 PMjverd wrote:
sarcasteak wrote:
jverd wrote:
sarcasteak wrote:
In the class that has the value, I create a new ObservableValue object and in the constructor I pass it the string. Now whenever I update the value I assume I do ov.setValue(search), so then the class that wants to get this value would implement observer.. but how does it get access to the ov instance?It registers itself as an observer. Did you read up on Observer/Observable?An observer for just that one instance of the ObvservableValue?Yes.
The problem is that I am not sure how to access the value from the secondary class.Your Observer must have an update() method. You understand that you have to implement the Observer interface, right? And you understand that to do so, you have to provide that method right? Have you looked at that method's signature? It provides you a reference to the Observable. You just cast it to whatever your class is and call the get method for the property you're interested in.
I understand that I need to add the observer, but I am not sure how I can do that if the secondary class(object) isn't being instantiated in the same object that passes the value.I have no idea what you mean by the last half of that sentence.
Have you tried maybe googling for java observer observable pattern? I'm sure there are plenty of examples available.Thanks, but I just ended up taking the easy way out and using an eclipse preference to pass values back and forth, not ideal since the values change so much. -
I've successfully erased unwanted graphics using Blend and I can drag a desired object that is behind the erased area, but the dragged object does not have mouse events unless I drag if from behind the erased area. Does anyone know a good work around or how I can force the event to be dispatched when the object behind the "glass wall" is clicked? I can't find documentation anywhere that addresses this situation. If an object behind can not be selected how is it really erased? Thanks in advance!
Yes, and I want to keep it behind. It's visible and can be dragged, but
since behind the transparent area that has been erased using Blend.Erase it
no longer receives click events. Thanks for your response.
Michelle -
HI
I have some problem,.
I heve class with propertis (String) :
public class Lis {
public String s1
public String s2
public String s3
}and I want to write Listener whitch run when I change s1 or s2 or s3.Hi.
1) Google: java listener example
2) you will receive e.g. this
3) read and make up your mind about it
Bye. -
Change objects between 2 Vectors
Voor mijn programma gebruik 2 Vectors (in klasse Schuif en Speelveld). In deze Vectors staan objecten van de klasse Steen (Een canvas, vierkantje met achtergrond).
How do I change a object Stone in Vector Playfield to Vector Slider and
substitute it for the first object Stone in Vector Slider and the substituted object Stone comes in for object Stone in Vector Playfield.
Vector Playfield Vector Slider
| | Steen | |
| | <----------> | |
| | | |
Or can i use something better than Vectors, like ArrayList???
I hope it's a little bit clear :S
Thanks in advanceHere is some of my code. Here i want to change 2 stones from place. This doesnot even work :-S
When I call the method verPlaatsStenen(), my app is hanging... :-S
How can i change 2 stones from place, just on the Playfield.
import java.awt.*;
import java.util.*;
public class Speelveld extends Panel
//private Steen[][] veld;
//private Vector veldX = new Vector(5);
private ArrayList veldX = new ArrayList(5);
private Color[] kleuren = { Color.blue,
Color.yellow,
Color.pink,
Color.cyan,
Color.green,
Color.magenta,
Color.red,
Color.black,
Color.black };
public Speelveld()
setLayout(null);
setBackground(Color.black);
for (int a =0; a < 5; a++)
for (int b = 0; b < 9; b++)
//veldX.add(a, new Vector(9));
veldX.add(a, new ArrayList(9));
for (int a =0; a < 5; a++)
for (int b = 0; b < 9; b++)
//((Vector)veldX.get(a)).add(b, new Steen(kleuren));
((ArrayList)veldX.get(a)).add(b, new Steen(kleuren[b]));
maakVeld();
public void maakVeld()
for (int x = 0; x < 5; x++)
for (int y = 0; y < 9; y++)
//Steen steen = (Steen)((Vector)veldX.get(x)).get(y);
Steen steen = (Steen)((ArrayList)veldX.get(x)).get(y);
//steen.setPositie((x * 45) + 10, (y * 45) + 10);
add(steen);
/*veld[x][y] = new Steen(kleuren[y]);
veld[x][y].setPositie((x * 45) + 10, (y * 45) + 10);
add(veld[x][y]);*/
/*public Steen getSteen(int rij)
return (Steen)((Vector)veldX.get(0)).remove(rij);
public void setSteen(Steen steen, int rij)
((Vector)veldX.get(1)).add(rij,steen);
maakVeld();
public void verplaatsStenen()
//Steen steen1, steen2;
Steen[] temp = new Steen[2];
temp[0] = (Steen)((Vector)veldX.get(3)).get(7);
temp[1] = (Steen)((Vector)veldX.get(4)).get(2);
((Vector)veldX.get(3)).remove(7);
((Vector)veldX.get(4)).remove(2);
((Vector)veldX.get(4)).add(7, temp[1]);
maakVeld(); -
Listen for a variable in externally-loaded interactive swf
Hi,
I'd like to set a variable inside an externally-loaded swf created in Flash Professional that is playing inside a Flex 4 application. The swf will "signal" the end of an interaction (using a s:SWFLoader). Once the variable is set (by arriving at a particular frame inside the externally-loaded swf, I'd like my Flex 4 application to "know" and take action to unload the swf and then "navigate" to another state with a new Flex-based interraction.
Perhaps a step-based illustration will be more clear:
1. Clicking a textfield inside a Flex 4 application loads a custom component that uses an <s:SWFLoader> to load an external SWF that includes buttons to navigate through frames in a "slideshow" fashion.
2. Once the end of the "slideshow" is reached, a variable is instantiated by
var swfEND:String = "swfDne";
3. I'd like my Flex 4 calling application to know when this event occurs, then I'd like the sef to unload and Flex to goto another state.
Any help, particularly on how to detect events in external swfs from Flex will be greatly appreciated.
Thanks,
Dougwanaryd,
> In my main timeline on frames this variable is changed
> (color = "red";) When the main timeline changes to a
> different location a new color is set. How do I make the
> movie clip listen for the color variable to change?
When the timeline changes to a different location, something
in that new
location changes the value of your color variable -- so why
not just update
the code in that location (or those locations) and have them
perform the
functionality that depends on the variable's value?
In any case, you should be able to use the Object.watch()
method.
Instead of creating a simple variable, create an instance of
the Object
class, then use the Object.watch() method to keep an eye on
things.
http://my.opera.com/darylducharme/blog/2007/02/13/the-object-watch-method
David Stiller
Co-author, Foundation Flash CS3 for Designers
http://tinyurl.com/2k29mj
"Luck is the residue of good design." -
How to create a listener for an Object.
Can someone help me with creating a listener for an Object?
What is the easiest way?
For example... if I have the following class.... how could I set up a listener to know if "attribute1" value has changed?
class MyObject {
private int attribute1;
private int attribute2;
// Set the attribute
public void setAttribute1(int num) {
attribute1 = num;This can be done but depends on your situation. give me some more details about the program.
In the worst scenario, u can set up a thread watching this variable to check for its previous value. if the value is different, u can get an alert. -
How do I print out the attributes of objects from a Vector? Help !
Dear Java People,
I have created a video store with a video class.I created a vector to hold the videos and put 3 objects in the vector.
How do I print out the attributes of each object in the vector ?
Below is the driver and Video class
Thank you in advance
Norman
import java.util.*;
public class TryVideo
public static void main(String[] args)
Vector videoVector = new Vector();
Video storeVideo1 = new Video(1,"Soap Opera", 20);
Video storeVideo2 = new Video(2,"Action Packed Movie",25);
Video storeVideo3 = new Video(3,"Good Drama", 10);
videoVector.add(storeVideo1);
videoVector.add(storeVideo2);
videoVector.add(storeVideo3);
Iterator i = videoVector.interator();
while(i.hasNext())
System.out.println(getVideoName() + getVideoID() + getVideoQuantity());
import java.util.*;
public class Video
public final static int RENT_PRICE = 3;
public final static int PURCHASE_PRICE = 20;
private int videoID;
private String videoName;
private int videoQuantity;
public Video(int videoID, String videoName, int videoQuantity)
this.videoID = videoID;
this.videoName = videoName;
this.videoQuantity = videoQuantity;
public int getVideoID()
return videoID;
public String getVideoName()
return videoName;
public int getVideoQuantity()
return videoQuantity;
}Dear Bri81,
Thank you for your reply.
I tried the coding as you suggested
while(i.hasNext())
System.out.println( i.next() );
but the error message reads:
"CD.java": Error #: 354 : incompatible types; found: void, required: java.lang.String at line 35
Your help is appreciated
Norman
import java.util.*;
public class TryCD
public static void main(String[] args)
Vector cdVector = new Vector();
CD cd_1 = new CD("Heavy Rapper", "Joe", true);
CD cd_2 = new CD("Country Music", "Sam", true);
CD cd_3 = new CD("Punk Music", "Mary", true);
cdVector.add(cd_1);
cdVector.add(cd_2);
cdVector.add(cd_3);
Iterator i = cdVector.iterator();
while(i.hasNext())
System.out.println( i.next() );
public class CD
private String item;
private boolean borrowed = false;
private String borrower = "";
private int totalNumberOfItems;
private int totalNumberOfItemsBorrowed;
public CD(String item,String borrower, boolean borrowed)
this.item = item;
this.borrower = borrower;
this.borrowed = borrowed;
public String getItem()
return item;
public String getBorrower()
return borrower;
public boolean getBorrowed()
return borrowed;
public String toString()
return System.out.println( getItem() + getBorrower()); -
How do I listen for changes in a container's components?
I have a JScrollPane that contains a JTextPane. I want any Container that can possibly contain my JScrollPane to be able to listen for changes in the JTextPane's Document.
For example, at the moment I'm using a JTabbedPane to hold a number of my JScrollPanes and I want to alter the tab title when any associated JScrollPane-JTextPane-Document is updated.
Any suggestions on how best to handle this?I would use a controller object that manages all your gui components (tabs, scrolls, documents, text panes). Your controller object can register as a listener to the appropriate component, and when it changes, update the title of a tab (or do whatever else) as appropriate.
Never put business logic like this stuff inside the actual gui components. Create, layout, etc. all the gui components (and related components like Document) from another controller like object instead. It makes handling the various listener stuff like this much easier. Read up on MVC (model view controller) stuff for more info.
As for the actual mechanics, you could get the document that is used in the JTextPane and register as a DocumentListener. As a document listener, you get notified of all changes that are made to that document. -
Need help for finding objects impacted by size change for an infoobject
hi all,
need help for finding objects impacted by size change
for xxx infoobject, due to some requirements, the size to be changed from
char(4) to char(10), in the source database tables as well as adjustment
to be done in BI side.
this infoobject xxx is nav attribute of YYY as well as for WWW
infoobjects. and xxx is loaded from infopkg for www infoobject load.
now that i have to prepare an impact analysis doc for BI side.
pls help me with what all could be impacted and what to be done as a
solution to implement the size change.
FYI:
where used list for xxx infoobject - relveals these object types :
infocubes,
infosources,
tranfer rules,
DSO.
attribute of characteristic,
nav attribute,
ref infoobject,
in queries,
in variablesHi Swetha,
You will have to manually make the table adjustments in all the systems using SE14 trans since the changes done using SE14 cannot be collected in any TR.
How to adjust tables :
Enter the table name in SE14. For ex for any Z master data(Say ZABCD), master data table name would be /BIC/PZABCD, text table would be /BIC/TZABCD. Similarly any DSO(say ZXYZ) table name would be /BIC/AZXYZ00 etc.
Just enter the table name in SE14 trans --> Edit --> Select the radio button "Save Data" --> Click on Activate & adjust database table.
NOTE : Be very careful in using SE14 trans since there is possibility that the backend table could be deleted.
How to collect the changes in TR:
You can collect only the changes made to the IO --> When you activate, it will ask you for the TR --> Enter the correct package name & create a new TR. If it doesn't prompt you for TR, just goto Extras --> Write transport request from the IO properties Menu screen. Once these IO changes are moved successfully, then the above proceduce can be followed using SE14 trans.
Hope it helps!
Regards,
Pavan -
How to change attributes of Objects of all windows in a MDI application
Hi,
I have a MDI application to draw Object. In these MDI windows I can modify attributes of Object like color, size... Now I want to create an option, when the user change or modifies attribute of Objects in a window, so it allow to change attributes of objects in all windows. I don't know how I can do it, please help me. ThanksAllow your objects to alias mutable attribute objects.
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.util.*;
import javax.swing.*;
import java.util.List;
public class Example extends JPanel {
private List bangles = new ArrayList();
protected void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2 = (Graphics2D) g;
for(Iterator j=bangles.iterator(); j.hasNext(); )
((Bangle)j.next()).paint(g2);
public void addBangle(Bangle bangle) {
bangles.add(bangle);
repaint();
public static void main(String[] args) {
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
Example app = new Example();
JFrame f = new JFrame("Example");
Container cp = f.getContentPane();
cp.add(app, BorderLayout.CENTER);
cp.add(Controller.create(app), BorderLayout.NORTH);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setSize(800,600);
f.setLocationRelativeTo(null);
f.setVisible(true);
class Controller {
private Shade shade1 = new Shade(Color.GREEN), shade2 = new Shade(Color.RED), currentShade=shade1;
private Example modelView;
public static JComponent create(Example modelView) {
return new Controller(modelView).createUI();
private Controller(final Example modelView) {
this.modelView = modelView;
modelView.addMouseListener(new MouseAdapter(){
public void mousePressed(MouseEvent evt) {
Rectangle shape = new Rectangle(evt.getX(), evt.getY(), 20, 20);
modelView.addBangle(new Bangle(shape, currentShade));
private JComponent createUI() {
ButtonGroup bg = new ButtonGroup();
final JToolBar tb = new JToolBar();
final JRadioButton rb1 = createRadio("Shade 1", true, shade1, bg, tb);
final JRadioButton rb2 = createRadio("Shade 2", false, shade2, bg, tb);
JButton btn = new JButton("Change color of selected shade");
btn.setContentAreaFilled(false);
btn.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent evt) {
Color newColor = JColorChooser.showDialog(tb, "Choose new color", currentShade.getColor());
if (newColor != null) {
currentShade.setColor(newColor);
if (currentShade == shade1)
rb1.setForeground(newColor);
else
rb2.setForeground(newColor);
tb.add(btn);
return tb;
private JRadioButton createRadio(String text, boolean selected, final Shade shade, ButtonGroup bg, JToolBar tb) {
JRadioButton rb = new JRadioButton(text, selected);
rb.setContentAreaFilled(false);
rb.setForeground(shade.getColor());
rb.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent evt) {
currentShade = shade;
tb.add(rb);
return rb;
class Bangle {
private Shape shape;
private Shade shade;
public Bangle(Shape shape, Shade shade) {
this.shape = shape;
this.shade = shade;
public void paint(Graphics2D g2) {
g2.setColor(shade.getColor());
g2.draw(shape);
class Shade {
private Color color;
public Shade(Color color) {
this.color = color;
public Color getColor() {
return color;
public void setColor(Color color) {
this.color = color;
} -
SWF panel listener for changed selection
In short, my question is as follows. Is it possible to create a listener which
detects when the current selection in the Flash authoring tool has changed,
and informs my SWF panel? This does not have to be a listener per se,
it can be some hand-crafted process which consumes some reasonable amount of processor time.
I describe my question more precisely below.
Suppose that I want to create an SWF extension panel for Flash (in Flash or Flex),
and I would like the panel to display a property of the object currently selected on scene
in the Flash IDE -- like the instance name of the object (if it exists).
I can use JSFL to detect the instance name of the selected object, and pass the string to the
SWF panel using call(), for instance. The problem is that I don't know how
to detect that the user has selected the object, or that the selection has changed.
Ideally, I would like to add an event listener that listens for such an action in the flash authoring tool.
However, using JSFL, this does not seem to be possible (I can only listen to events such as frame changed
or layer changed, but not selection changed).
I tried the following solutions:
1. Periodically check in JSFL whether the current selection has changed.
The problem is that in JSFL, there is no sleep function, or anything alike. The javascript
methods setInterval and setTimeout do not work in JSFL. Therefore, in order to periodically check for changes,
one must actively loop. This is extremely resource-consuming -- in fact, it hangs the flash IDE.
2. The periodic check can be triggered by the SWF panel itself. In actionscript, I can use setInterval to periodically
invoke the selection update function via JSFL. I have set the interval to 400 milliseconds, which gives a reasonably quick
reaction to changes. However, the functionality I want to implement is in fact more complicated than just retrieving the
instance name of the selected object. As a consequence, performing this operation every 400 milliseconds still consumes
too much processor time (the flash IDE consumes 30% of my processor time, even if the user doesn't do anything).
Therefore, I still would like to find a solution which does not use the processor when the user does not do anything in the Flash IDE.I'm trying to do the same thing. Did you find a solution?
-
How to create many objects listening for one event
I'm experimenting with the EventDispatcher class and I have a
test class working. I want to use a loop to create a variety of
movie clips that all listen for an event that gets dispatched every
half a second. I have the event dispatching properly. My problem is
that when creating the objects, the temporary variable I use to
hold each created object has a life that extends beyond the loop in
which it is instantiated. Rather than all five created objects
changing color, only the last one changes color (see the code
below--it lives on the first frame of an FLA file).
This is not entirely surprising when I look at the code --
'this' refers to the global scope and 'square' refers to the last
created object that it pointed to. Here's the resulting trace:
handler runing, square name is square 4
this class name is global
handler runing, square name is square 4
this class name is global
handler runing, square name is square 4
this class name is global
handler runing, square name is square 4
this class name is global
handler runing, square name is square 4
this class name is global
How can I modify this code so that each square object changes
its own color?graphics.clear in the context of that function handler in my
code would refer not to the squares but to the global scope,
wouldn't it? In which case you'd be clearing all the graphics from
your top level movie. I tried changing 'square.graphics' to just
'graphics' in my handler and my squares just remained the original
steady black.
Your code doesn't use a loop and therefore isn't re-using a
variable. You've escaped my 'logical errors' through brute force.
(BTW, I think my code would work in AS2 if I used the old-school
draw methods). Suppose you had to create 100 objects? Would you
want to manually instantiate each one, typing that function over
and over again? You'd have 500 lines of highly redundant code!
Maybe try your example using a loop instead? I think you'll
find it's pretty tough to sneak any vars like 'i' or 'square' from
the global scope into the handler--the handler refers to the
living, breathing variable rather than it's value at the time the
handler was instantiated. Furthermore, you can't sneak any
information about the square into your handler via the event object
because the event object is created in a totally different place. -
JTextfield listening for changes from other class
Hi,
Assuming I have a Jtextfield in one of the class1 extend Jframe,
how do I update the jtextfield so that it could up make accessible by other class and continuously updated to reflect the input for value rom another class2.
In other words very much similar to the observable model view concept
class 1 may be look like
private void initComponents() {
jTextField1 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jTextField1.setEditable(false);
class 2 may be look similar to the following
public void out_1(){
setStop1("N");
for (int i=1;i<100;i++){
class_1.getJTextField1().setText(String.valueOf(i)); // System.out.println(i);
setOuti(i);
setStop1("N");HI,
I have attempted with the following coding , test 1 the source display generated using Netbeans GUI , t est2 the worker code ,and mybean the bean , so far nothing seems to work .
I have not try the threaded swing concept as I am not familar with the concurrency but i am not sure whether propertylistener will do the job or not
In summary , list of method employed are :
binding the jtextfield1 to a bean,
jtextfield add document listener ,
Coding objective
1. Test 1 defined jtexfield1 and jbutton
2 Jbutton added actionlistener , where upon click,
Execute Test 2 which will assign a series of integer to the bean , own setters & getters, Output is achieved via Test 1 jtextfield1 supposingly to display all the running number from 1 to 99 continuously until the test2 out_1 method finished the execution
Anyone could provide the assistance .
Thank
* Test_1.java
* Created on July 25, 2007, 9:23 PM
package sapcopa;
import java.beans.PropertyChangeListener;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.text.Document;
import sapcopa.MyBean.*;
public class Test_1 extends javax.swing.JFrame {
/** Creates new form Test_1 */
// private Test_2 t2=new Test_2();
private String input_txt;
public Test_1() {
myBean1=new MyBean();
myBean1.addPropertyChangeListener(new java.beans.PropertyChangeListener(){
public void propertyChange(java.beans.PropertyChangeEvent evt) {
bean_chg(evt);
initComponents();
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
private void initComponents() {
myBean1 = new sapcopa.MyBean();
jTextField1 = new javax.swing.JTextField();
jTextField1.getDocument().addDocumentListener(new MyDocumentListener());
jButton1 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jTextField1.setEditable(false);
jTextField1.setText(myBean1.getRecord_Process());
jTextField1.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
public void propertyChange(java.beans.PropertyChangeEvent evt) {
txt1_chg(evt);
jButton1.setText("jButton1");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
But1(evt);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(19, 19, 19)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(32, 32, 32)
.addComponent(jButton1)))
.addContainerGap(131, Short.MAX_VALUE))
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(21, 21, 21)
.addComponent(jButton1)
.addContainerGap(216, Short.MAX_VALUE))
pack();
}// </editor-fold>//GEN-END:initComponents
private void txt1_chg(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_txt1_chg
// TODO add your handling code here:
//myBean1=new MyBean();
try {
jTextField1.setText(myBean1.getRecord_Process());
} catch (Exception e){
e.printStackTrace();
}//GEN-LAST:event_txt1_chg
private void bean_chg(java.beans.PropertyChangeEvent evt){
jTextField1.setText(myBean1.getRecord_Process());
private void But1(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_But1
//getJTextField1().getDocument().addDocumentListener(new MyDocumentListener());
Test_2 t2=new Test_2();
t2.out_1();
try{
System.out.println("Button 1 mybean->"+myBean1.getRecord_Process());
} catch (Exception e){
e.printStackTrace();
// TODO add your handling code here:
}//GEN-LAST:event_But1
* @param args the command line arguments
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Test_1().setVisible(true);
public javax.swing.JTextField getJTextField1() {
return jTextField1;
public void setJTextField1(javax.swing.JTextField jTextField1) {
this.jTextField1 = jTextField1;
class MyDocumentListener implements DocumentListener {
final String newline = "\n";
public void insertUpdate(DocumentEvent e) {
// updateLog(e, "inserted into");
String vstr=myBean1.getRecord_Process().toString();
jTextField1.setText(vstr);
public void removeUpdate(DocumentEvent e) {
//updateLog(e, "removed from");
String vstr=myBean1.getRecord_Process().toString();
jTextField1.setText(vstr);
public void changedUpdate(DocumentEvent e) {
//Plain text components don't fire these events.
String vstr=myBean1.getRecord_Process().toString();
jTextField1.setText(vstr);
public void updateLog(DocumentEvent e, String action) {
Document doc = (Document)e.getDocument();
int changeLength = e.getLength();
// jTextField1.setText(String.valueOf(changeLength));
String vstr=myBean1.getRecord_Process().toString();
jTextField1.setText(vstr);
public String getInput_txt() {
return input_txt;
public void setInput_txt(String input_txt) {
this.input_txt = input_txt;
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JTextField jTextField1;
private sapcopa.MyBean myBean1;
// End of variables declaration//GEN-END:variables
* Test_2.java
* Created on July 25, 2007, 9:26 PM
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
package sapcopa;
import sapcopa.MyBean.*;
public class Test_2 {
private Test_1 t1=new Test_1();
private int outi;
private String stop1;
MyBean mybean;
/** Creates a new instance of Test_2 */
public Test_2() {
public void out_1(){
setStop1("N");
mybean=new MyBean();
for (int i=1;i<100;i++){
mybean.setRecord_Process(String.valueOf(i));
setOuti(i);
setStop1("N");
setStop1("Y");
public int getOuti() {
return outi;
public void setOuti(int outi) {
this.outi = outi;
public String getStop1() {
return stop1;
public void setStop1(String stop1) {
this.stop1 = stop1;
* MyBean.java
* Created on July 24, 2007, 12:00 AM
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
package sapcopa;
import javax.swing.JTextField;
public class MyBean {
/** Creates a new instance of MyBean */
public MyBean() {
* Holds value of property record_Process.
private JTextField txt_rec_process;
private String record_Process;
* Utility field used by bound properties.
private java.beans.PropertyChangeSupport propertyChangeSupport = new java.beans.PropertyChangeSupport(this);
* Adds a PropertyChangeListener to the listener list.
* @param l The listener to add.
public void addPropertyChangeListener(java.beans.PropertyChangeListener l) {
propertyChangeSupport.addPropertyChangeListener(l);
* Removes a PropertyChangeListener from the listener list.
* @param l The listener to remove.
public void removePropertyChangeListener(java.beans.PropertyChangeListener l) {
propertyChangeSupport.removePropertyChangeListener(l);
* Getter for property record_Process.
* @return Value of property record_Process.
public String getRecord_Process() {
return this.record_Process;
* Setter for property record_Process.
* @param record_Process New value of property record_Process.
public void setRecord_Process(String record_Process) {
String oldRecord_Process = this.record_Process;
this.record_Process = record_Process;
propertyChangeSupport.firePropertyChange("record_Process", oldRecord_Process, record_Process);
* Holds value of property rec_Match.
private String rec_Match;
* Getter for property rec_Match.
* @return Value of property rec_Match.
public String getRec_Match() {
return this.rec_Match;
* Setter for property rec_Match.
* @param rec_Match New value of property rec_Match.
public void setRec_Match(String rec_Match) {
String oldRec_Match = this.rec_Match;
this.rec_Match = rec_Match;
propertyChangeSupport.firePropertyChange("rec_Match", oldRec_Match, rec_Match);
public JTextField getTxt_rec_process() {
return txt_rec_process;
public void setTxt_rec_process(JTextField txt_rec_process) {
JTextField oldTxt_rec_process=this.txt_rec_process;
this.txt_rec_process = txt_rec_process;
propertyChangeSupport.firePropertyChange("txt_rec_process", oldTxt_rec_process, txt_rec_process);
} -
Operation ' Change Attribute TSTATE ' could not be carried out for Request
hi,
i am unable to delete the request Id from DSO. and when i checked that, it says request is partially activated(error occured during the activation)
and when i checked the logs i got the following error messages:
Operation ' Change Attribute TSTATE ' could not be carried out for Request 609249
Termination in problem report 'RSS2_DTP_RNR_SUBSEQ_PROC_SET' in row ' 361'
i even thought it was BASIS issue but it was not.
due to this error the process chain is failing daily
kindly help
regards
lakshhi arvind,
i tried using the both the methods you had mentioned, i am able to delete the request at that moment but its again coming back, i think as it is a partially activated request so may be that is why it is happening
but the problem is still there
regards
Laksh
Maybe you are looking for
-
Error: The operation can't be completed because the original item cannot be found
Hi folks. I had to get a new MacBook Pro (old one died twice in two weeks despite being loved and cared for) today (ouch- skint!) and now need to install Final Cut Studio to it. "No problem" thought I, "I will use Remote Disc!" Assuming that my eve
-
Webservice client : different wsdl file for test/production environment
In an ADF application, I need call a web service in model project In my company, we have 2 environments : test and production. This webservice is deploye in test server and production server. So there are 2 different wsdl file for test/production. I
-
Safari 4 tabs do not display unread counts for GMail and Google Reader
To reproduce this, do the following: 1. Create a bookmark for either GMail or Google Reader 2. Click on the bookmark under Safari to load either site (make sure it has at least on unread item) The text in the tab title will not display the unread cou
-
Cannot find the specified instance exception
Hello, I am having a problem with my Bpel process. when I post to XML, i am getting the following: <Fault env="http://schemas.xmlsoap.org/soap/envelope/" > <faultcode>env:Server</faultcode> <faultstring>java.lang.IllegalStateException: Cannot call se
-
Install error :InvocationTargetException
I am installing Weblogic v 6.1 sp2 on Sun Solaris 8 on executing the command " sh weblogic600sp2_sol.bin -i console" the installation starts and after selecting the language as English, console displays the following error and the installation stops,