Skip to Main Content

Java SE (Java Platform, Standard Edition)

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!

JTabbedPane with non-tabbed text

843804Mar 11 2005 — edited Mar 12 2005
OK, I'm stuck (again)

What I would like to do is have a tabbed pane (2 tabs) and then put some text (maybe in a JLable) on the same line as the tabs. I'll try to draw a picture for clearity. Anyone have any ideas about how to do this?

 ______    ______
/ tab1 \ /tab2  \         Here is some text
================================
|    This is what changes                             |
|            when you switch tabs                     |
|                                                                        |
================================
I think you can get the idea from that 'picture.'

Comments

807557
It depends on which shell the script is using.: sh, ksh, bash...
You should find plenty of examples in /etc/init.d
807557
Hi,
Actually i want to set the variable in crontab and use the same variable in the script that is located else where. I have to run 5-6 scripts which uses this variable. So i want to define it in the Crontab file and use the same in the shell script.
Eg : I edited the crontab file of root as follows
NEW_HOME=/export/home/general
DB_SETUP=user/user@user
59 17 * * * /export/home/general/executeScript1.sh


executeScript1.sh is located in /export/home/general, which is as follows :
#!/bin/bash
echo "$NEW_HOME"
if [ -r "$NEW_HOME"/cron.log ]; then
echo "file is listed in the Directory"
else
echo " file is not listed"
exit 2
fi

when i execute the script under /export/home/general it works fine : it echos "file is listed in the Directory" since NEW_HOME is set in the env.
But when i excute the same in cron it doesnt. the var that is echo "$NEW_HOME" is blank. So how do i set the variable so that it can be picked when the script is being execute from cron

thanks
user4994457
Hi,
Actually i want to set the variable in crontab and
use the same variable in the script that is located
else where. I have to run 5-6 scripts which uses this
variable. So i want to define it in the Crontab file
and use the same in the shell script.
The crontab format doesn't allow that.
Eg : I edited the crontab file of root as follows
NEW_HOME=/export/home/general
DB_SETUP=user/user@user
59 17 * * * /export/home/general/executeScript1.sh
I would assume you got an error about invalid lines in the crontab.
when i execute the script under /export/home/general
it works fine : it echos "file is listed in the
Directory" since NEW_HOME is set in the env.
But when i excute the same in cron it doesnt. the var
that is echo "$NEW_HOME" is blank. So how do i set
the variable so that it can be picked when the script
is being execute from cron
Set the environment prior to each line. You mention 5-6 scripts. That's not too many to just cut&paste the environment in your favorite editor.

59 17 * * * NEW_HOME=/export/home/general DB_SETUP=user/user@user /export/home/general/executeScript1.sh

--
Darren
807557
Thanks Darren, that works. Can you plz help me on one more issue.
In the scripts i was mentioning, i am actaully picking a few .xls files converting them into .txt files husning JXCEL. After the successfull conversion we call a java program which connects to the DB ( thats what theDB_SETUP variable is for) which executes a set of procedures fro storing the content from the .txt file into the DB. On successfull execution of the procedure i call a mailer program which send mail to the respective uses. All the above process i automate it using Cron. As i already mentioned the above set up works fine in linux where we set the vaibales intially in itself unlike in solaris where you mentioned its has to be set along with the scheduled script. Now For the above process of calling java program, connecting to DB, then excuting a mail i need to set a few jars in the class path as follows :
CLASSPATH=/DataConversion/DataConversionMail/ogi_ims/lib/activation.jar:/DataConversion/DataConversionMail/ogi_ims/lib/classes12.jar:/DataConversion/DataConversionMail/ogi_ims/lib/log4j-1.2.8.jar:/DataConversion/DataConversionMail/ogi_ims/lib/mail.jar:/DataConversion/DataConversionMail:.
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/opt/j2sdk_nb/j2sdk1.4.2/bin:$ORACLE_HOME/bin

The above 2 lines i set in the beginning in the crontab file in Linux. But I dont think i can do the same in Solaris crontab file. But my java programs embedded within the shell script will be pointing to these jars, so how i do put these jars in class path of the cron env when the script executes from the crontab file.
Please let me know if you need any other info.

Thanks in advance
rgds
Vijay Kumar Yenne
1 - 4
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 9 2005
Added on Mar 11 2005
3 comments
342 views