How to make versionable object of different class than Document?
In the programmers reference is that every PublicObject can be versioned, but there are only samples for versioning documents. I would like to keep history on folder hierarchy changes, so I think I need a Folder that can be versioned.
The question is how to do this?
Should I override isVersionable method in subclass of Folder to return true?
Please help
Hi
I am havin 10 text boxes in my application.
But out of 10 , 3 will be always together(existence of one is not possible without the other two.)
Now i want to create a vector of objects ( here object will consist of the value corresponding to these three boxes),there can be many elements in this vector.
So i m thinking to make an inner class which have three String variables corresponding to these text boxes that exists together.
What can b done ?
Similar Messages
-
How to make an object of inner class and use it ?
Hi tecs,
In my JSF application i have a need to make an inner member class in one of my bean class.
How can i make the object of this class?(what should be the entry in faces-config)
And there are text box and check box (in the JSP) associated with the elements of this inner class. What should be the coding in JSP so that elements in the JSP can be linked with the corresponding members of the inner class ?
Plz help.
Thnx in advance.Hi
I am havin 10 text boxes in my application.
But out of 10 , 3 will be always together(existence of one is not possible without the other two.)
Now i want to create a vector of objects ( here object will consist of the value corresponding to these three boxes),there can be many elements in this vector.
So i m thinking to make an inner class which have three String variables corresponding to these text boxes that exists together.
What can b done ? -
How to make a object of Directory Class
hi
i want to pass the value "C:\\opt\\lucene\\didyoumean\\indexes\\spell" to the "spellIndexDirectory"
here is my code
package org.tiling.didyoumean;
import java.io.IOException;
import org.apache.lucene.index.Term;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.spell.SpellChecker;
import org.apache.lucene.store.Directory;
class spell{
public static void main(String args[]){
System.out.println("hi");
Directory spellIndexDirectory = new Directory("C:\\opt\\lucene\\didyoumean\\indexes\\spell");
SpellChecker spellChecker = new SpellChecker(spellIndexDirectory);
String[] similarWords = spellChecker.suggestSimilar("jva", 1);
System.out.println("the suggestion is"+ similarWords[0]);
this way it gives me this errorC:\Documents and Settings\sumit-i\Desktop\didyoumean\didyoumean-1.0\src\java>javac org/tiling/didyoumean/spell.java
org\tiling\didyoumean\spell.java:17: org.apache.lucene.store.Directory is abstract; cannot be instantiated
Directory spellIndexDirectory = new Directory("C:\\opt\\lucene\\didyoumean\\indexes\\spell");
^
1 error
how can i resolve this issue......i am not getting how to pass value to the Directory....
any idea please....You can't instantiate abstract objects. When you need an object of an abstract class, you actually end up with an object of a (non-abstract, a.k.a. "concrete") class. You get those in one of these ways:
1) the abstract class might have a static method that gives you an object of a subclass
2) there might be a different class that has a method (static or not) that gives you an object of the first abstract class.
3) there are subclasses in the API that you can instantiate directly.
As already suggested, re-read the docs. -
How to access form objects from different class?
Hello, I am new to java and i started with netbeans 6 beta,
when i create java form application from template i get 2 classes one ends with APP and one with VIEW,
i put for example jTextField1 with the form designer to the form and i can manipulate it's contents easily from within it's class (let's say it is MyAppView).
Question>
How can i access jTextField1 value from different class that i created in the same project?
please help. and sorry for such newbie question.
Thanks Mikehmm now it says
non static variable jTree1 can not be referenced from static context
My code in ClasWithFormObjects is
public static void setTreeModel (DefaultMutableTreeNode treemodel){
jTree1.setModel(new DefaultTreeModel(treemodel));
and in Class2 it is
ClasWithFormObjects.setTreeModel(model); -
How to make an object mutable?
Can any one tell me how to make an object mutable?
Following is Class X & Y?
class Y
public static void main(String arg[]) {
X a1=new X();
Object a=a1.get();
System.out.println(a.toString());
a1.set(a);
System.out.println(a.toString());
class X implements Serializable
public Object get(){
return new Object();
public synchronized void set(Object o)
o=null;
In my class Y when i say
a1.set(a);
I want local Object a of main method should be nullified.
Can it be possible if yes what is the way or code to be applied so that
my next a.toString() statement will give me NullpointerException.Isn't it more accurate to say that object references are passed by value?
OP -- Basically you can't to what you want to do. When you "pass an object" as a method parameter, what you're really passing is a copy of the reference that points to the object. You now have two refs pointing to the same object--one in the caller and one in the method being executed. Setting either of those refs to null does NOT affect the object itself, and does NOT affect the other ref. It just means that the ref that's been set to null no longer points to any object.
If you want the called method to make a change that the caller can see, you need to either 1) return a value from the method, 2) encapsulate the object to be changed as a member of new class, or 3) pass the object to be changed as the single element of an array. I would STRONGLY recommend against (3) as a way to simulate pass by reference. Better to examine your design and determine whether (1) or (2) more closely matches what you're really trying to accomplish. -
How to make an object distributed across multiple jres?
Hi,
We used cache data mechanism for performance tuning. It will store data in static variable (Hashtable) and get initialized when app starts . We are using IPlanet Application Server and
Using 6 KJS engines. This object ( Hashtable) is not distributed across all JRES.It has to reinitialize data again when request goes to any other KJS.
We avoid sharing data in session and request, as data is huge.
Can any one help us how to make this object distributed across all KJSs?
Thanks in advance.
rajWe used cache data mechanism for performance tuning.
It will store data in static variable (Hashtable) and
get initialized when app starts.
We are using IPlanet Application Server and
Using 6 KJS engines. This object ( Hashtable) is not
distributed across all JRES. It has to reinitialize
data again when request goes to any other KJS.
We avoid sharing data in session and request, as data
is huge.
Can any one help us how to make this object
distributed across all KJSs?When you say 'initialized when app starts' do you mean iPlanets StartUp classes, rather than the Servlets init() ? Given a 'huge' dataset, avoid the latter.
I'd suggest that a better approach is to implement this as an Entity Bean and accessed from Session bean and using Value Objects to return the data subsets.
Checkout the Java Pet Store
http://java.sun.com/blueprints/code/jps13/datasheet.html -
How to make any object self-shining?
hi,
i guess thats an easy question, but i dont know where to look for the answer.
so how to make any object self-shining like the infamous colorcube, so that one does not need to place any light?
and am I right in my assumption that doing so will reduce the need of rendering power, since lights dont have to be computed?
thanx,
UsulI'm not sure what you mean here- if your object is lit then lighting will need to be calculated. If you don't want shapes to be lit, I think you can disable it by calling setLightingEnable(false) in their materials.
-
HOw to make an Object oriented alv respond to double click
Hi all,
HOw to make an Object oriented alv respond to double click.SAmple code will be helpful.
Thanks in advance,
Alex.Hi,
1. Create a Control (for Custom and Split Containers only)
2. Instantiate a Container Object (in case of Custom and Split Containers, specify the control which is created by us in Screen painter) CREATE OBJECT
3. Instantiate an Object of the kind of report that has to be displayed (List, Grid or Tree). CREATE OBJECT . Here we need to specify the Parent Container as the so that it sits in that container.
4. Call appropriate methods to display the report on the screen. CALL METHOD ->
DATA : g_dock TYPE REF TO cl_gui_docking_container,
g_split TYPE REF TO cl_gui_easy_splitter_container,
g_cont1 TYPE REF TO cl_gui_container,
g_cont2 TYPE REF TO cl_gui_container,
g_grid1 TYPE REF TO cl_gui_alv_grid,
g_grid2 TYPE REF TO cl_gui_alv_grid.
i_mara is an internal table of structure MARA
SELECT * FROM mara INTO TABLE i_mara.
i_kna1 is an internal table of structure KNA1
SELECT * FROM kna1 INTO TABLE i_kna1.
To create an Object of type Docking Container
CREATE OBJECT g_dock
EXPORTING
side = cl_gui_docking_container=>dock_at_top
extension = 200 .
To Create an Object of Type Split Container. Here we can see that the Docking *Container Created above has been used as a parent .
CREATE OBJECT g_split
EXPORTING
parent = g_dock
orientation = 1 .
Easy Split container splits one Control into 2 manageable controls, each of them is used * to handle one GUI Container each
g_cont1 = g_split->top_left_container.
g_cont2 = g_split->bottom_right_container.
To Create an Object of type Grid . Here we can see that the Left Split Container * Created above has been used as a parent .
CREATE OBJECT g_grid1
EXPORTING
i_parent = g_cont1 .
To Create an Object of type Grid . Here we can see that the Right Split Container * Created above has been used as a parent .
CREATE OBJECT g_grid2
EXPORTING
i_parent = g_cont2 .
The method of Grid Control Object is used to display the Data.
CALL METHOD g_grid1->set_table_for_first_display
EXPORTING
i_structure_name = 'MARA'
CHANGING
it_outtab = i_mara[] .
The method of Grid Control Object is used to display the Data.
CALL METHOD g_grid2->set_table_for_first_display
EXPORTING
i_structure_name = 'KNA1'
CHANGING
it_outtab = i_kna1[] .
Regards
Hari -
How to create an object of a class?
plz read the question carefully ..
how to create the object of a class by giving the class name as an String
suppose i have a java file name:" java1.java ".
so now how to create an object of this class "java1"by passing a string "java1"..kajbj wrote:
rajeev-usendi wrote:
thanks but still i have problem..
i have created the object but now i m unable to do anything with that created object..
i have coded like this..
Object o= Class.forName("java1").new Instance();
after this i m unable to do anything with the object 'o'..So why did you create the instance? You can also get all methods using reflection, but that is probably not what you want to do. You should instead let the class implement an interface and cast the created object into that interface ans call the methods that you want to call.
KajI agree with Kaj. If you need to use a class that's unavailable at compile time, you should create an appropriate interface by which to refer to the class and then you create instances reflectively and access them normally via their interface (which is called reflective instantiation with interface access) -
How to make Shape3D object translucent
Hi,
How to make Shape3D object (like Box, Cylinder) translucent? I tried the below option but the box is not becoming translucent at all.
final PhongMaterial redMaterial = new PhongMaterial();
redMaterial.setSpecularColor(Color.rgb(10, 255, 15, opacity));
redMaterial.setDiffuseColor(Color.rgb(10, 255, 15, opacity));
final Box box = new Box(width,height,depth);
box.setMaterial(redMaterial);
When opacity is 1, the color of the box will be Green, when it is 0 the color becomes black.
Is there any way the box can be made translucent?There is at least one unresolved issue concerning PhongMaterial's transparency: RT-28874.
I'm neither able to get it working properly. My red Sphere also fades to black while varying the opacity value from 1.0 to 0.0.
August -
How to make the item in different color in a choice?
if I have a choice and different items, how to make the item in different color?
like:
Choice ColorChooser = new Choice();
ColorChooser.add("100");
ColorChooser.add("200");
ColorChooser.add("300");
I want to show green, red and blue color for item 100, 200 and 300.
I do not know how to do that, anyone can help?
ThanksPlease don't double (and now your up to triple) post. I realize that to you, your problem is the most important thing in the world and it would be nice if you could get several people working on it at the same time. However, the people answering your question do not get paid for it. They are doing it because they want to help someone. Posting several times only shows that you have no respect for them and are only concerned with your problem.
-
When it's required to share a single object in different classes????
Hi friends...
I am new to java programming language....
when it is required to share a single object in different classes???
and
please give me one example with explanation...
Thank you
regards Shreesun_shree wrote:
Thanks for all giving reply.....
please write the constructor which is accepting reference and please,,,,,, explain......
Thanking youNo.
This will be covered in any Java textbook or tutorial. Like this one: [http://java.sun.com/docs/books/tutorial/java/javaOO/arguments.html]
After reading it and writing some code of your own to test your understanding, if you still have a specific question, post again. -
How to make the keyword red in the searched document
if the word document are loaded into the blob field,when the proper document are searched by the keyword,how to make the keyword red in the selected document!
thanks a lot!Take a look at the CTX_DOC.MARKUP procedure in the Oracle8i interMedia Text Reference.
<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by zhai ping ([email protected]):
if the word document are loaded into the blob field,when the proper document are searched by the keyword,how to make the keyword red in the selected document!
thanks a lot!<HR></BLOCKQUOTE>
null -
Two equal objects, but different classes?
When programming on binding Referenceable object with JDK version 1.5.0_06, I have encountered a very strange phenomenon: two objects are equal, but they belong to different classes!!!
The source codes of the program bind_ref.java are listed as below:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
import java.lang.*;
import java.io.*;
import java.util.*;
import javax.naming.*;
import javax.naming.spi.ObjectFactory;
import java.util.Hashtable;
public class bind_ref {
public static void main( String[] args ) {
// Set up environment for creating the initial context
Hashtable env = new Hashtable();
env.put( Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory" );
env.put( Context.PROVIDER_URL, "file:/daniel/" );
Context ctx = null;
File f = null;
Fruit fruit1 = null, fruit2 = null;
byte [] b = new byte[10];
try {
ctx = new InitialContext( env );
Hashtable the_env = ctx.getEnvironment();
Object [] keys = the_env.keySet().toArray();
int key_sz = keys.length;
fruit1 = new Fruit( "Orange" );
SubReference ref1 = fruit1.getReference();
ctx.rebind( "reference", fruit1 );
fruit2 = ( Fruit )ctx.lookup( "reference" );
System.out.println( "ref1's class = (" + ref1.getClass().toString() + ")" );
System.out.println( "fruit2.myRef's class = (" + fruit2.myRef.getClass().toString() + ")" );
System.out.println( "( ref1 instanceof SubReference ) = " + ( ref1 instanceof SubReference ) );
System.out.println( "( fruit2.myRef instanceof SubReference ) = " + ( fruit2.myRef instanceof SubReference ) );
System.out.println( "ref1.hashCode = " + ref1.hashCode() + ", fruit2.myRef.hashCode = " + fruit2.myRef.hashCode() );
System.out.println( "ref1.equals( fruit2.myRef ) = " + ref1.equals( fruit2.myRef ) );
} catch( Exception ne ) {
System.err.println( "Exception: " + ne.toString() );
System.exit( -1 );
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
All the outputs are shown as below:
=======================================================
Fruit: I am created at Mon Jun 18 11:35:13 GMT+08:00 2007
SubReference: I am created at Mon Jun 18 11:35:13 GMT+08:00 2007
--------- (i)subref.hashCode() = (-1759114666)
SubReference: I am created at Mon Jun 18 11:35:13 GMT+08:00 2007
--------- (i)subref.hashCode() = (-1759114666)
FruitFactory: obj's class = (class javax.naming.Reference)
FruitFactory: obj's hashCode = -1759114666
FruitFactory: obj = (Reference Class Name: Fruit
Type: fruit
Content: Orange
FruitFactory: ( obj instanceof SubReference ) = false
FruitFactory: subref_class_name = (Fruit)
Fruit: I am created at Mon Jun 18 11:35:13 GMT+08:00 2007
ref1's class = (class SubReference)
fruit2.myRef's class = (class javax.naming.Reference)
( ref1 instanceof SubReference ) = true
( fruit2.myRef instanceof SubReference ) = false
ref1.hashCode = -1759114666, fruit2.myRef.hashCode = -1759114666
ref1.equals( fruit2.myRef ) = true
========================================================
I hightlight the critical codes and outputs related to the strangeness with bold texts.
Who can tell me what happens? Is it really possible that two objects belonging to different classes are equal? If so, why that?It can also depend on how you implement the equals method.
class Cat {
String name;
Cat(String n) {
name = n;
class Dog {
String name;
Dog(String n) {
name = n;
public boolean equals(Object o) {
return name.equals(o.name);
public static void main(String[] args) {
Dog d = new Dog("Fred");
Cat c = new Cat("Fred");
System.out.println(d.equals(c));
} -
How do i create objects of ordinary Classes from a javabean
I want to create a class Person below that I want to create an object from in my javabeans.
Look below Person class definition for continuation.
package data;
public class Person
private String name;
public Person()
name = "No name yet.";
public Person(String initialName)
name = initialName;
public void setName(String newName)
name = newName;
public String getName()
return name;
public void writeOutput()
System.out.println("Name: " + name);
public boolean sameName(Person otherPerson)
return (this.name.equalsIgnoreCase(otherPerson.name));
I run this bean class in the WEB-INF/classes/data folder creating a Person object in the deal() method below
When I compile the class it seems to fail. It does not recognise the Person class. Can you help me with a description of what to do to call
ordinary class objects from javabean class definitions.
What directories should the simple classes be put and what should I include in the javabean to be able to access them?
package data;
import java.sql.*;
import data.*;
public class Bean
{ private Connection databaseConnection ;
// private Person p;
public Bean()
super();
public boolean connect() throws ClassNotFoundException, SQLException
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String sourceURL = "jdbc:odbc:robjsp";
databaseConnection = DriverManager.getConnection(sourceURL);
return true;
public ResultSet execquery(String restrict) throws SQLException
Statement statement = databaseConnection.createStatement();
String full = "SELECT customerid,CITY,Address from customers " + restrict;
ResultSet authorNames = statement.executeQuery(full);
return (authorNames ==null ) ? null : authorNames;
public String deal() throws SQLException
{ Person p = new Person();
p.setName("Roberto");
return p.getName();
}There is no "Copy File" function in Lightroom.
Lightroom was designed to eliminate the need to make duplicate copies of files. The organizational tools in Lightroom allow you to have one file categorized in many ways, you can assign multiple keywords to the photos (for example: Winery, Finger Lakes, Fall Foliage, Jessica). Similarly, you can have a file categorized in multiple Lightroom collections at the same time, all without making a copy of the photo. The benefit of this is that you don't need to make multiple copies of each photo, one copy suffices, and thus disk space is saved; and furthermore if you should edit a photo or add metadata, you only need to do this once, and the photo's appearance, or the photo's metadata is changed, and visible to you no matter how you choose to access the photo (pick any keyword or any collection and you will see the change)
Maybe you are looking for
-
Daear All, while doing goods issue getting the error message : Acct. 200510 for trans./event key BSX, postable directly. the same in goods receipt also. please help me on this. Best Regards, Venkat.
-
My Windows 7 Pro went completely doo-Lally - I reinstalled the Windows 7 but I forgot to do anyting with Itune. What I would like to know is, how do I get 2 playlists back into Itunes and then move audiobooks back into them. As I said earlier, I have
-
Image Inconsistency between LR2.2 and other apps - even on Desktop
I've calibrated my monitor, and the images look perfect in LR. I export as jpg (sRBG), and when viewed in ACDSee, or even set as Background on the desktop (OS is Vista) the images turn up very saturated. I have to turn down the saturation in LR to ge
-
Hello I need to implement FTP to BW scenario. I transfer CSV file to BW and I think about validation. In XI system the validation is very complicated and I think to make the validation in the client side. I think to write some applet in Java and plac
-
How to handle Supplementary Bills
Hi all, Can any one suggest me how to handle the supplementary bills in indian localization? The concept is encountered in cases when companies follow contract agreements in sales and purchase. To provide a breif description of the scenario: A contra