Re: How to Write MakeFile ?

1998-11-25 Thread Catalin CLIMOV

Hi,
Here is a patch a wrote so you can use "mmake" with SourceNavigator.
When you press the "make" button in SN, it will give the filename to the make
command, and this may be a problem , especially when you have your sources in a
directory structure that reflects the packages.
Just put this script in one of your "bin" directories and run it instead of
"mmake" to create your Makefile.

Catalin.

Ramesh Babu A. wrote:

>  Hi,
>
> How to write MakeFile for Java in Linux ?
>
> Here I have snippet of makefile code. But it does not
>
> working properply (When I each time give cmd like
>
> make -f MakeFile, it compiles each java files even it's
>
> time is not modified.)
>
> If anybody know mail to me.
>
>
>  Regards,
>
>  Ramesha
>
>
> 
>
> MakeFile
>
> ---
>
>
>   #**
>   #
>   #  Makefile for JAVA GUI
>   #
>   #  Author:Ramesh .A Babu, TeneT Group, 4078,,
>   #
>   #
>   #  Change Log: 
>   # 
>   #
>   #*/
>
>  CLASSES = Status.class FirstDemo.class UserPortMgr.class RTMgr.class \
>   SecondLevelMgr.class Tester.class UpdateInterface.class \
>   FileViewer.class  FillUtils.class FillNetwork.class  \
>   UserPort.class CodeDownLoad.class \
>   LineCard.class MntcPkt.class   PostTest.class
>
>
>
>
>  all: $(CLASSES)
>
>  # ** Directory Path for JFC compiler 
>
>  JAVAC  = /usr/local/jdk116/bin/
>
>  # * Java files to be compile ***
>
>
>  # Single dependent java files
>
>  UpdateInterface.class: UpdateInterface.java
> $(JAVAC) UpdateInterface.java
>
>  FileViewer.class:  FileViewer.java
> $(JAVAC) FileViewer.java
>
>  FillUtils.class:   FillUtils.java
> $(JAVAC) FillUtils.java
>
>  FillNetwork.class: FillNetwork.java
> $(JAVAC) FillNetwork.java
>
>  LineCard.class:LineCard.java
> $(JAVAC) LineCard.java
>
>  MntcPkt.class: MntcPkt.java
> $(JAVAC) MntcPkt.java
>
>  PostTest.class:PostTest.java
> $(JAVAC) PostTest.java
>
>  UserPortMgr.class: UserPortMgr.java
> $(JAVAC) UserPortMgr.java
>
>  RTMgr.class:   RTMgr.java UserPortMgr.java
> $(JAVAC) RTMgr.java
>
>  SecondLevelMgr.class:  SecondLevelMgr.java
> $(JAVAC) SecondLevelMgr.java
>
>  Status.class:  Status.class MntcPkt.java
> $(JAVAC) Status.java
>
>  # *** Clean unwanted files *
>
>  clean:
> rm -f *.*~ core *~
>
>
>  #  End of Makefile **
>
>





f_rec () {
if [ "$1" = "" ]
then
pattern=*
else
pattern=$1/*
fi

for fn in $pattern
do
case $fn in
*.java)
echo `basename $fn`:
echo "  \$(JAVAC) \$(JAVAC_FLAGS) " $fn
echo ;;
*)
if [ -d $fn ]
then
f_rec $fn
fi ;;
esac
done
}

mmake
if [ -f Makefile ]
then
line=`cat Makefile | grep -n "# Build Rules" | cut -f 1 -d :`
line=`expr $line + 2`

head Makefile -n $line > Makefile.new
echo "# mmake patch: insert each java target" >> Makefile.new
f_rec $1 >> Makefile.new
echo "# mmake patch ends here" >> Makefile.new
tail Makefile -n +$line >> Makefile.new
rm Makefile
mv Makefile.new Makefile
fi



Re: A very elementary question ?

1998-11-26 Thread Catalin CLIMOV

Mehrdad Jahansoozi wrote:
Hi,
    The problem is with your CLASSPATH, and maybe with
PATH, too
    First you will have to add your "/MyJavaDir/jdk117/bin/"
to your PATH variable (PATH=%PATH:/MyJavaDir/jdk117/bin). An alternative
solution is to make symbolic links of the java binaries (like java, javac,
and so on) to a directory that is already in PATH (like /usr/bin):
    "ln -s  /MyJavaDir/jdk117/bin/java  /usr/bin",
and so on.
    Second, you have to set your CLASSPATH:
    "CLASSPATH=.:/MyJavaDir/jdk117/lib/classes.zip"
    Third:
    "cd /MytestDir"
    "java Test"
    That's all. It should work. If you encounter any
problems, please contact me for details.

Catalin.
Hi,
I installed JDK 117 on a newly and painfully installed Linux Red Hat
5.1

I wrote a small Java program.
When I type
 /MyJavaDir/jdk117/bin/javac /MyyestDir//Test.java
Test.class is generated
Then I type
 /MyJavaDir/jdk117/bin/java   /MyyestDir//Test
I get a message
  invalid class name: /MyJavaDir/jdk117/Test

How do you run your Java on Linux ?

Regards,

Mehrdad
 
-- 
 \|/  \|/ 
  @~/ Oo \~@  
 /_( \__/ )_\ 
    \__U_/
 


JWindow.setLocation()

1998-11-27 Thread Catalin CLIMOV

Hi,
I have an application in a JFrame, and sometimes I have to show a
JWindow somewhere on the screen.
It seems JWindow.setLocation() is not working properly. To be more
precise, my JWindow appears always at (0,0), doesn't matter the real
location I want.
But if I move the JFrame on the screen (with the mouse), and then
display JWindow, it shows where it has to.
I use jdk 1.1.7-v1a-glibc with native threads on a RedHat5.1.

Does anyone know what is happening, and how can I solve that ?

Catalin.



Re: JWindow.setLocation()

1998-11-27 Thread Catalin CLIMOV

Hi Robert,
I'm using KDE.
I think I found a way to temporary solve the problem in my case.
I've noticed that JWindow.setLocation() works fine if the JWindow.isVisible().

Fortunately, I use a class that extends JWindow, so I have overridden the
setLocation method:
public void setLocation(int x, int y)
{
if(!isVisible())
{
setVisible(true);
super.setLocation(x,y);
setVisible(false);
}
else
super.setLocation(x,y);
}

And now it seems to work.

Robert P. Biuk-Aghai wrote:

> I suspect it's a window manager problem. Which wm do you use?

>
>
> I too have noticed problems that I believe to be wm problems. In my
> case, using fvwm, when I start an application (extending JFrame from
> Swing 1.0.2) with a menubar it is placed at position 0,0. When I click
> on a menu in the menubar, the menu is displayed aligned with the top
> edge of the menubar, which is also the top edge of the JFrame's
> internal area, rather than being aligned with the bottom edge of the
> menubar. This has unpleasant side effects when clicking on the menu
> and releasing the mouse button, as this is taken as a mouse click on
> whatever menu item (mostly the first one) that is displayed in the
> menu at that position), rather than posting the menu below the mouse
> cursor awaiting user selection. However, when I move the window
> around, even back to 0,0, it works fine.
>
> Any advice on this one, or do I just have bear it with patience?
>
> Robert.
>
> On Fri, 27 Nov 1998, Catalin CLIMOV wrote:
>
> > Hi,
> > I have an application in a JFrame, and sometimes I have to show a
> > JWindow somewhere on the screen.
> > It seems JWindow.setLocation() is not working properly. To be more
> > precise, my JWindow appears always at (0,0), doesn't matter the real
> > location I want.
> > But if I move the JFrame on the screen (with the mouse), and then
> > display JWindow, it shows where it has to.
> > I use jdk 1.1.7-v1a-glibc with native threads on a RedHat5.1.
> >
> > Does anyone know what is happening, and how can I solve that ?
> >
> > Catalin.
> >
>
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> Robert P Biuk-Aghai, University of Macau, Faculty of Science and Technology
> http://hyperg.sftw.umac.mo/robert/tel: +853-3974365fax: +853-838314
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> Microsoft isn't the answer. Microsoft is the question and the answer is no.



--
 \|/  \|/
  @~/ Oo \~@
 /_( \__/ )_\
\__U_/





Re: JWindow.setLocation()

1998-11-30 Thread Catalin CLIMOV

I tried it and it is not working.
But as I stated in a previous mail, nit is working fine if the JWindow
isVisible().


Gregg G. Wonderly wrote:

> >But if I move the JFrame on the screen (with the mouse), and then
> >display JWindow, it shows where it has to.
> >I use jdk 1.1.7-v1a-glibc with native threads on a RedHat5.1.
> >
> >Does anyone know what is happening, and how can I solve that ?
>
> The base AWT has many courtesy calls to "repaint".  Swing seems not
> to which allows it to execute faster since repainting is kept to a
> minimum.  However, this puts the responsibility on the program to repaint
> with wild abandon to make sure that changes are displayed to the user.
> Anytime you modify a component within another component, you need to remember
> to call repaint.  Add a Window.repaint() call and I bet it will work.
>
> -
> [EMAIL PROTECTED]  (C2 Technologies Inc)



--
 \|/  \|/
  @~/ Oo \~@
 /_( \__/ )_\
\__U_/





Re: JWindow.setLocation()

1998-11-30 Thread Catalin CLIMOV

Anguel Anguelov wrote:

> Catalin CLIMOV wrote:
>
> > I tried it and it is not working.
> > But as I stated in a previous mail, nit is working fine if the JWindow
> > isVisible().
> >
> > Gregg G. Wonderly wrote:
> >
> > > >But if I move the JFrame on the screen (with the mouse), and then
> > > >display JWindow, it shows where it has to.
> > > >I use jdk 1.1.7-v1a-glibc with native threads on a RedHat5.1.
> > > >
> > > >Does anyone know what is happening, and how can I solve that ?
> > >
> > > The base AWT has many courtesy calls to "repaint".  Swing seems not
> > > to which allows it to execute faster since repainting is kept to a
> > > minimum.  However, this puts the responsibility on the program to repaint
> > > with wild abandon to make sure that changes are displayed to the user.
> > > Anytime you modify a component within another component, you need to remember
> > > to call repaint.  Add a Window.repaint() call and I bet it will work.
> > >
> > > -
> > > [EMAIL PROTECTED]  (C2 Technologies Inc)
> >
> > --
> >  \|/  \|/
> >   @~/ Oo \~@
> >  /_( \__/ )_\
> > \__U_/
>
> I suppose you are working on KDE. I meen this is one bug of KDE. Try with another
> XWindows.

I tried it also with twm and the problem remains,

--
 \|/  \|/
  @~/ Oo \~@
 /_( \__/ )_\
\__U_/





Re: Repaint problems with JList/JScrollPane/JSplitPane

1998-12-08 Thread Catalin CLIMOV

Try also a myList.revalidate() also. It works.

Catalin CLIMOV.

Trieu Dang wrote:

> Hi,
> My application uses a JSplitPane in which the top and bottom components
> are JScrollPane. The bottom scrollpane contains a JList. My list changes
> depending on the user's actions so I have to use setListData, which must
> be followed by repaint(), otherwise the data wouldn't change.
>
> e.g.
> myList.setListData(arrayOfStrings);
> myList.repaint();
>
> My problem is when I use setListData & repaint for the first time (i.e.
> the list was empty, hence no scrollbar initially), the scroll bars do
> not appear automatically. But once I click on the divider of the
> splitpane, they appeared. I tried to call repaint on the scrollpane and
> splitpane as well, but that didn't change anything.
>
> Does anyone have a suggestion?
> Thanks in advance.
>
> Trieu Dang
> [EMAIL PROTECTED]
>
> (Since I'm not subscribed to the mailing list, it'd be nice if you could
> send your reply to my email address. Thanks in advance.)



--
 \|/  \|/
  @~/ Oo \~@
 /_( \__/ )_\
\__U_/





Re: Q: Language determination???

1998-12-23 Thread Catalin CLIMOV

Hi,
Have a look at java.util.Locale

Catalin.


Dirk Schreiber wrote:

> Hello,
>
> i am looking for  a function which returns  the currently used language.  I
> can't find anything in the system.properties or api index.
>
> Any ideas??? -Thanks for any helpfull advice...
>
> I wish all a merry christmas and a happy new year...
>
> CU Dirk.
> --
> ---
> Dirk Schreiber\|/fax   :+49 241 877743
> Aachen/Germany   (o o)   mailto:[EMAIL PROTECTED]
> -ooO--(_)--Ooo-



--
 \|/  \|/
  @~/ Oo \~@
 /_( \__/ )_\
\__U_/





Re: finalizer()

1999-01-05 Thread Catalin CLIMOV

Very strange.
I tried to run your code and it worked fine with java (it displayed 'finelize'),
but it didn't work with jre (it finished without displaying anything).
I use the same jdk on Linux 5.1, kernel 2.0.34.

Catalin CLIMOV.

John Summerfield wrote:

> I have this code:
> public class  F
>{
>   protected void finalize() throws Throwable
>  {
> System.out.println("finalize");
> super.finalize();
>  }
>   public static void main(String[] args) throws Throwable
>  {
> F f = new F();
> System.runFinalizersOnExit(true);
> Runtime.getRuntime().runFinalizersOnExit(true);
> f = null;
> System.gc();
>  }
>}
>
> My documentation leads me to expect that finalize() will be run and produce
> this output:
>
> finalize
>
> However, it produces no output.
>
> [summer@possum summer]$ java -fullversion
> java full version "Linux_JDK_1.1.7_v1a_green_threads"
>
> I'm running RedHat Linux 5.0, kernel 2.0.36:
> [summer@possum summer]$ uname -a
> Linux possum.os2.ami.com.au 2.0.36 #4 Wed Dec 30 20:13:06 WST 1998 i686 unknown
>
> --
> Cheers
> John Summerfield
> http://os2.ami.com.au/os2/ for OS/2 support.
> Configuration, networking, combined IBM ftpsites index.



--
 \|/  \|/
  @~/ Oo \~@
 /_( \__/ )_\
\__U_/





Re: A Global instance ?

1999-10-13 Thread Catalin Climov


package mypackage;

public class Global // use this class to keep your global properties
{
private Global() // disable it's constructor, since all its members are
static
{
}

static // This is the static initialization. It is performed after the
class is loaded into jvm
{
res = new MyResource();
// other init stuff
}

private static MyResource res;
public static MyResource getRes()
{
return res;
}
}

Then just import the Global class wherever you need it, and access resources
with Global.getRes(), i.e.

- Original Message -
From: Robert Simmons Jr. <[EMAIL PROTECTED]>
To: Java <[EMAIL PROTECTED]>
Sent: Wednesday, October 13, 1999 1:31 PM
Subject: A Global instance ?


> I have a gizmo that keeps track of resources for a program. The problem
> is that Im ending up passing this gizmo to every child component and
> that is beginning to bug me. In C++ I ould just create a global static
> var and let everyone access it. This is one of those rare cases where
> its a good idea. ALL parts use the same instance and the instance is
> read once (at the beginning) and written once(at program shutdown)
> anyone have any more elgant solution then passing it all over the damn
> place ?
>
> --rob
>
>
> --
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact
[EMAIL PROTECTED]


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]