JAAS - How to set up permissions for a specific code?

I would like to set up permissions for specific code in JAAS policy files.
In other words, let's say I have the followiong entry:
permission java.util.PropertyPermission "java.home", "read";
Then, when I do Subject.doAsPrivileged(..., MyAction), if this permission is absent, I will not be able to access the "java.home" property in my MyAction.
If I, let's say, set up a file permission, I will not be able to read certain files if the permission is absent.
I want something simpler. I want to be able to specify that the whole class MyAction cannot be executed if the permission is absent - I do not want the code to even go there. Basically, if the necessary entry in the Policy file is not present, I do not want the calling code to have access to class com.mypackage.MyAction.
This must be really straight-forward, what am I missing?

Thank you for your input.
My case is a little bit more complex.
There is a request and approval process attached to the provision to this target system.
The approval process has a first level of approval (including 1 to many approval steps) and the user gets the basic access to this target system. The user can then access the target system but is limited to what he/she can do.
Then the approval goes to a second level of approval (including many approval steps) and if approved the user gets the elevated access to this target system.
To accomplish this, the previous implementer created 2 resources for the same target. After the first level of approval, he provisioned resource A to the user. After the second level of approval, he provisioned resource B to the user, revoked resource B, and updated resource A.
This is very confusing because we are dealing with 2 resources for the same target.
I am looking for way to take advantage of the GTC to provision and reconcile with a system that takes a flat file and can write a flat file. But I also need to make it work with this approval nightmare.
Do you have any ideas on how to make this better and simpler?
Thanks
Khanh

Similar Messages

  • How to set file permissions for SFTP uploaded file?

    Hello,
    is it possible to set file permissions with the SDK for files uploaded via SFTP transfer? I use the default sample plugin ftp_upload.lrdevplugin to transfer the files, but would like to tweak it to set the uploaded file(s) to permission 644 (rw-,r--,r--) on Linux server. Currently the server sets new file(s) by default to 600 (rw-,---,---).
    I am looking for an option to do the "chmod" directly from Lightroom without doing any modificatios in general to default umask, etc. settings on the server. No real UI is needed for this. Just hardcoded setting for 644 in the .lua.
    So far I've been unsuccesful in finding the way. Googled, read this forum, looked at the API. Maybe I just missed it, or does this functionality exist?
    All advice is appreciated!
    Cheers,
    Timo

    Niel's suggestion is good. You might also try posting your question in the Tiger Server forums. I'm sure Tiger Server has several ways of dealing with this.

  • How to set default permissions for files and folders

    We have mac and windows computers on a network where we use Mac OSX Server 10.4 to share files. When files are created on windows computer, no problem, all users can read/write these files. However on our 2 macs (1 10.3 and 1 10.4), other users are blocked from using the files, only the owner has "read/write", group and others are "read only". As far as I can tell, file sharing is turned on ok in Workgroup Manager for the folders we share files from. How can we establish sharing for all users on our network?

    Niel's suggestion is good. You might also try posting your question in the Tiger Server forums. I'm sure Tiger Server has several ways of dealing with this.

  • How to set Blocking Indicator for product specific TransportationLanes?

    Hi All,
    I'm facing a problem while trying to set the blocking indicator for product specific Transportation Lanes-external procurement.
    How can i proceed on the same?
    I've figured out 2 methods for blocking the product specific TLanes.
    1. using /SAPAPO/TR_TL_TRANSFER_BAPI.
    2. using BAPI_TRLSRVAPS_SAVEMULTI.
    I tried using the BAPI - /SAPAPO/TR_TL_TRANSFER_BAPI, which comes inside the DELETE BAPI - BAPI_TRLSRVAPS_DELMULTI. Although I had passed the parameters reg. external procurement, nothing seemed to be happening in the system. There was no blocking indicator - D(locked and flagged for deletion) set against the subjected TLane. In fact, to my amazement, the BAPI didn't return even a single msg. BAPIRETURN internal table after execution was empty.
    Here, I'm passing:
    (IV_LOGQS) TYPE  /SAPAPO/LOGQS
    (IV_LOGSYS) TYPE  LOGSYS
    (IV_CALLER) TYPE  /SAPAPO/MD_CALLER
    (IT_TR) TYPE  /SAPAPO/TR_TTD_TR
    (IT_TR_X) TYPE  /SAPAPO/TR_TTX_TR
    (IT_TRPROD_SRC) TYPE  /SAPAPO/TR_TTD_TRPROD_SRC    and
    (IT_TRPROD_SRC_X) TYPE  /SAPAPO/TR_TTX_TRPROD_SRC
    I haven't tried on the second method yet. Is there any other programming alternative for setting the blocking indicator of a TLane / multiple Tlanes?
    Could anyone pls explain and guide me on a suitable method to be chosen and the process to be followed, parameters to be passed, etc.

    Hi Sanjay,
                    Use the standard BAPI:  BAPI_TRLSRVAPS_SAVEMULTI2 (according to SCM version you are using)
    to update the deletion flag for product specific T-lane, in this BAPI you have to pass the data to EXTERNAL_PROCUREMENT parameter table in which LOCKED_FLG field is there in which you can pass the "D" for deletion or block flag.
    Also you have to pass the same entries in EXTERNAL_PROCUREMENT_X parameter table of this BAPI.
    If any further help required, refer the documentation of BAPI or let me know.
    I hope this will help you to solve the issue.
    Regards,
    Saurabh

  • Iplanet 4.1 - How to set session timeout for a specific application

    Hi everyone,
    I have a Iplanet 4.1 old web instance running on Solaris 8. We are using this web instance to connect to few application instances running on Websphere 3.5. We have upgraded most of our web/app to higher version except this.
    One of the websphere applications need more session timeout. (Which I fuguredout not possible to do on Websphere).
    How do I achieve this on Iplanet 4.1.
    NOTE: I referred to Iplanet 6.x where we can achieve this by updating web-app.xml timeOut value per URI. I do not find web-app.xml under v4.1
    Thanks in advance,

    Sorry to say that we can't help here. WS4.1 is obsolete a long time ago.
    As you mentioned that you should use WS6.1SPx or WS7.0 for your production and get support.

  • How do we set the permissions for....

    Using Acrobat 9, Setting permissions is very confusing!
    How do we set the permissions for document so that:
    -- the end user needs no password
    -- Printing: Allowed
    -- Changing the Document: Not Allowed
    -- Doument Assembly: Not Allowed
    -- Content Copying: Not Allowed
    -- Content Copying for Accessability: Not Allowed
    -- Page Extraction: Not Allowed
    -- Commenting: Allowed
    -- Filling of Form Fields: Allowed
    -- Signing: Not Allowed
    -- Dreating of Template Pages: Not Allowed

    Not possible. If you allow filling in forms you must allow signing. BTW, while it is nice to be able to set permissions anything that depends upon passwords that you set is easily overcome by third party utilities. Don't do anything that really depends upon these permissions. If you want to set permissions using the Document Properties Dialog box (control D), then click on the Security button. In the Security Method Dialog box, select password security and fill it out as you need.

  • IMac at work, iMac at home. (Latest Yosemite and Apple Remote Desktop updates installed) Need to work from home at night. I don't know how to set my permissions so that I can just control my iMac at work.

    iMac at work, iMac at home. (Latest Yosemite and Apple Remote Desktop updates installed) Need to work from home at night. I don't know how to set my permissions so that I can just control my iMac at work.

         If they have set up port forwarding for you already then that is different.  In that case, then you could be experiencing the bug with the most recent release of ARD (3.7.2) and in particular ARD 3.7.2 and Yosemite ARD version 3.8 clients.  It has been reported numerous times in the forums and to Apple that since 3.7.2, clients are frequently unavailable to connect to despite there being no network issue between the remote computer and client computer.  I have not seen anyone report it who was working from outside the LAN to inside the LAN, but I have the same issue with a number of my own computers that are simply on a different subnet, so it stands rot reason that it would happen from a port forwarding location.
         I am sometimes able to resolve the issue locally by SSH connecting into the client computer using Terminal on my admin machine and restarting or relaunching the ARD agent on the remote device, then trying to connect to it again after about 30 seconds.
    The Terminal commands for this procedure are as follows, though you might need to include a port number from outside the LAN:
    First:
    ssh ipaddress -l adminusername
    (example: ssh 192.168.1.1 -l macadmin)
    Second:
    sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/k ickstart -restart -agent
    After that, waiting about 30 seconds and trying to observe or control usually works, though the computer may still fail to show an online or lit-up status indicator.

  • Set windows permissions for folder

    My labview app is being installed to the prog files dir for the app by an installer created by the LV Dev System.  i encounter a problem when trying to store a config file for the app to the directory during user customization of settings after app installation because the file I am trying to update is read only due to win 7 defaults.  I try to set the permissions for the folder programmatically, but it does not change the folder to a NOT read only one.  What is the trick here?  Do I need to put my config files in another directory somewhere or is ther a way to change the folder settings so I can create temp files in that folder?

    Creating temporary config files in Program Files is not very good practice. I would do it in the public user folder.
    How are you setting the parameters?
    Did you use the following?
    http://zone.ni.com/reference/en-XX/help/371361J-01/glang/set_permissions/
    http://zone.ni.com/reference/en-XX/help/371361J-01/glang/setting_permissions/
    Excerpt from the link above:
    You can use permissions to change only write permissions for users (bit 7); the operating system ignores all other changes to the bits.
    Beginner? Try LabVIEW Basics
    Sharing bits of code? Try Snippets or LAVA Code Capture Tool
    Have you tried Quick Drop?, Visit QD Community.

  • [SOLVED] setting up permissions for mounted usb devices

    Hi all,
    I've been having the following problem when mounting my external hd: in order to mount the external hd I created a folder /mnt/usbstick/ giving permissions to a non-root user to read the files/directories in this folder (using chmod); however, after I mount the external hd, the set of permissions for /mnt/usbstick/ change so that a non-root user cannot  read the mounted files in /mnt/usbstick. This is a problem for me because, when I copy a file from the external hd to the non-root home folder, the copied file can only be read by the root user.   
    Do you know how I can solve this problem? Should I write a udev rule and place it at /etc/udev/rules.d/? Or should I simply add the non-root user to a specific group from /etc/group? Any ideas?
    Thanks!
    Last edited by falsum (2010-05-08 09:21:59)

    You could try adding an entry for your usb device in /etc/fstab and specify the option user to let non-superusers mount it.
    Here's an example of an entry for my external HD. I'm sure there are probably other (and better) ways to do this but it works for me.
    UUID=4376-0BFB /media/FIRELITE vfat rw,user,noauto,async 0 0
    Nice howto found on the wiki: http://wiki.archlinux.org/index.php/Fstab

  • How to set Compatibility Mode for a single site in ie10

    This question was originally posted on the Answers forum -
    http://answers.microsoft.com/en-us/ie/forum/ie10-windows_7/how-to-set-compatibility-mode-for-a-single-site-in/187152e3-142a-4d96-8d1b-af82ef571eec
    I am having problem with getting ie10 to set ie9 compatibility for a single site (sharepoint.contoso.com).
    When I add this website in Compatibility View Settings (Alt > Tools > Compatibility View Settings > 'Add this Website') it adds the domain 'contoso.com' and not the individual website (sharepoint.contoso.com).
    This cause other sites (www.contoso.com) to be configured to use compatibility mode. Because this is a separate site (different web server) to the site sharepoint.contoso.com (sharepoint 2010 server) we need different compatibility settings.
    Using a different example to explain the issue -
    Microsoft has three websites that are different websites created by different developers written in different programming languages and they only work with certain browsers.
    microsoft.com (Website1 created by Developer1) - compatible with ie8/ie9/ie10
    msdn.microsoft.com (Website2 created by Developer2) - compatible with ie8/ie9
    technet.microsoft.com (Website3 website created by Developer3) - compatible only with ie10
    The only thing the three website share is the URL contains 'microsoft.com'.
    Marking 'msdn.microsoft.com' to run in compatibility mode affects the other 2 websites - mainly technet.microsoft.com which will not work now since it only runs in pure ie10 mode. 
    Should you be able to add an individual site to the compatibility list instead of all sites that have  .microsoft.com in the URL? Am I missing a simple setting in the ie10?
    As a workaround I am using the F12 Developer Tools to set the Browser Mode which temporary sets the compatibility mode. However this is not a nice solution to the end users at our organisation. 

    problem is not solved for non corporate environments...
    You could start your own thread.  Then if you got that answer and it was marked Answered you would have the ability to unmark it.  The OP of this one seems satisfied.  Also note that this is TechNet.  Consumers can get help on Answers
    forums.
    Robert Aldwinckle
    Oh! I wrote it wrong: I should have said: This is not solved for NON-AD environments. No demands what so ever to use Window 7/8 professional in a small corporation or on a big corporation with Island of smaller departments for example offshore.
    The problem is that the thread is not "Answered" by the OP, its is marked answered by a moderator (and same moderator that did the answer) so no way of telling if the OP is satisfied.
    But you are right in the fact that I am almost kidnapping the thread. But a complete answer would benefit all in this case I would presume.
    Regards
    /Aldus

  • How to set a   background for jFrame?

    Hai.i have a code for background image.i.e
    * TextOver.java
    * Created on June 23, 2008, 1:53 PM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.image.BufferedImage;
    import java.io.IOException;
    import java.net.MalformedURLException;
    import java.net.URL;
    import javax.imageio.ImageIO;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    public class TextOver
    private static final String IMAGE_PATH =
    "http://upload.wikimedia.org/wikipedia/commons/b/b5/HMS_Cardiff_%28D108%29_1.jpg";
    private BufferedImage image;
    private JTextArea textarea = new JTextArea(20, 40);
    private JPanel mainPanel = new JPanel()
    @Override
    protected void paintComponent(Graphics g)
    super.paintComponent(g);
    if (image != null)
    g.drawImage(image, 0, 0, this);
    public TextOver()
    URL imageUrl;
    try
    imageUrl = new URL(IMAGE_PATH);
    image = ImageIO.read(imageUrl);
    Dimension imageSize = new Dimension(image.getWidth(), image.getHeight());
    mainPanel.setPreferredSize(imageSize);
    JScrollPane scrollpane = new JScrollPane(textarea);
    textarea.setOpaque(false);
    scrollpane.setOpaque(false);
    scrollpane.getViewport().setOpaque(false);
    mainPanel.add(scrollpane);
    catch (MalformedURLException e)
    e.printStackTrace();
    catch (IOException e)
    e.printStackTrace();
    public JPanel getPanel()
    return mainPanel;
    private static void createAndShowGUI()
    admin_login_code a=new admin_login_code();
    a.setVisible(false);
    JFrame frame = new JFrame("TextAreaOverImage Application");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().add(new TextOver().getPanel());
    frame.pack();
    frame.setLocationRelativeTo(null);
    frame.setVisible(false);
    public static void main(String[] args)
    javax.swing.SwingUtilities.invokeLater(new Runnable()
    public void run()
    createAndShowGUI();
    i want to give this backgground to my existing jFrame something like
    import java.sql.*;
    import java.io.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class admin_login_code extends javax.swing.JFrame {
    String admin_name;
    String password;
    Connection con;
    Statement stmt;
    ResultSet rs;
    public admin_login_code() {
    initComponents();
    jPasswordField1.addKeyListener(new KeyAdapter() {
    public void keyTyped(KeyEvent e) {
    char c = e.getKeyChar();
    if (!(Character.isDigit(c) ||
    (c == KeyEvent.VK_BACK_SPACE) ||
    (c == KeyEvent.VK_DELETE))) {
    getToolkit().beep();
    e.consume();
    jFormattedTextField1.addKeyListener(new KeyAdapter() {
    public void keyTyped(KeyEvent e) {
    char c = e.getKeyChar();
    if (!(Character.isLetter(c) ||
    (c == KeyEvent.VK_BACK_SPACE) ||
    (c == KeyEvent.VK_DELETE))) {
    getToolkit().beep();
    e.consume();
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">
    private void initComponents() {
    jLabel1 = new javax.swing.JLabel();
    jPanel1 = new javax.swing.JPanel();
    jLabel2 = new javax.swing.JLabel();
    jFormattedTextField1 = new javax.swing.JFormattedTextField();
    jLabel4 = new javax.swing.JLabel();
    jPasswordField1 = new javax.swing.JPasswordField();
    jPanel2 = new javax.swing.JPanel();
    jButton1 = new javax.swing.JButton();
    jButton3 = new javax.swing.JButton();
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    jLabel1.setFont(new java.awt.Font("Tahoma", 1, 36));
    jLabel1.setForeground(new java.awt.Color(255, 0, 0));
    jLabel1.setText("ADMIN LOGIN");
    jLabel2.setFont(new java.awt.Font("Tahoma", 1, 24));
    jLabel2.setText("Admin Name");
    jFormattedTextField1.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jFormattedTextField1ActionPerformed(evt);
    jLabel4.setFont(new java.awt.Font("Tahoma", 1, 24));
    jLabel4.setText("Password");
    jPasswordField1.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jPasswordField1ActionPerformed(evt);
    org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
    jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(jPanel1Layout.createSequentialGroup()
    .add(39, 39, 39)
    .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(jLabel4)
    .add(jLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 161, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
    .add(43, 43, 43)
    .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(jPasswordField1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 190, Short.MAX_VALUE)
    .add(jFormattedTextField1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 190, Short.MAX_VALUE))
    .addContainerGap())
    jPanel1Layout.setVerticalGroup(
    jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(jPanel1Layout.createSequentialGroup()
    .add(47, 47, 47)
    .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
    .add(jLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 34, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
    .add(jFormattedTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
    .add(60, 60, 60)
    .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(jLabel4)
    .add(jPasswordField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
    .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    jButton1.setText("Login");
    jButton1.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jButton1ActionPerformed(evt);
    jButton3.setText("Exit");
    jButton3.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jButton3ActionPerformed(evt);
    org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(
    jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel2Layout.createSequentialGroup()
    .add(38, 38, 38)
    .add(jButton1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 93, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 110, Short.MAX_VALUE)
    .add(jButton3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 93, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
    .add(55, 55, 55))
    jPanel2Layout.setVerticalGroup(
    jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(jPanel2Layout.createSequentialGroup()
    .add(38, 38, 38)
    .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
    .add(jButton3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 32, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
    .add(jButton1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 32, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
    .addContainerGap(30, Short.MAX_VALUE))
    org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(layout.createSequentialGroup()
    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(layout.createSequentialGroup()
    .add(574, 574, 574)
    .add(jLabel1))
    .add(layout.createSequentialGroup()
    .add(459, 459, 459)
    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
    .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
    .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
    .addContainerGap(521, Short.MAX_VALUE))
    layout.setVerticalGroup(
    layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(layout.createSequentialGroup()
    .add(149, 149, 149)
    .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 66, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
    .add(43, 43, 43)
    .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
    .add(42, 42, 42)
    .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
    .addContainerGap(250, Short.MAX_VALUE))
    pack();
    }// </editor-fold>
    private void jPasswordField1ActionPerformed(java.awt.event.ActionEvent evt) {
    private void jFormattedTextField1ActionPerformed(java.awt.event.ActionEvent evt) {                                                    
    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {                                        
    Object src=evt.getSource();
    if(src==jButton3)
    dispose();
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
    Object src=evt.getSource();
    if(src==jButton1)
    admin_name=jFormattedTextField1.getText();
    password=jPasswordField1.getText();
    try
    Class.forName("oracle.jdbc.driver.OracleDriver");
    con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcle","scott","root");
    stmt=con.createStatement();
    rs=stmt.executeQuery("select admin_name,password from admin_registration where admin_name='chandana' and password='8989' ");
    while(rs.next())
    if(admin_name.equals(rs.getString(1))&&password.equals(rs.getString(2)))
    admin_registration a=new admin_registration();
    a.setVisible(true);
    dispose();
    else
    JOptionPane.showMessageDialog(null,"Please enter admin name & password ");
    catch(ClassNotFoundException e)
    e.printStackTrace();
    catch(SQLException e)
    e.printStackTrace();
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    admin_login_code a=new admin_login_code();
    a.setVisible(true);
    // Variables declaration - do not modify
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton3;
    private javax.swing.JFormattedTextField jFormattedTextField1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPasswordField jPasswordField1;
    // End of variables declaration
    Can any one can help me how to set a background for jFrame?
    Thank you in advance.
    Edited by: forums.com on Jul 14, 2008 1:40 AM

    90% of the code you posted is not relevant to your question.
    If you want further help post a Short, Self Contained, Compilable and Executable, Example Program (SSCCE) that demonstrates the problem.
    And don't forget to use code tags when posting code.

  • How to set default values for boolean columns

    I'm trying to deploy some content types and columns into a site with a feature. All it's ok, except that I'm trying to set a default value for boolean columns with no success.
    I've tried to set default value at column level:
    <Field ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DisplayName="Se publican noticias en español"
    Type="Boolean" Hidden="FALSE" Group="Columnas ShaCon" >
    <Default>TRUE</Default>
    </Field>
    and at content type level:
    <FieldRef ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DefaultValue="TRUE" Required="TRUE" />
    But in any case, when i create a new item with this content type, default value is applied.
    Can anyone tell how to set default values for boolean columns?
    Thanks in advance,
    Regards,
    Sergio

    In the field definition you can set
    <Default>1</Default>
    or
    <Default>0</Default>
    How to set the default value Null?

  • How to create a Platinum,Gold and Silver Customer and how to set different price for a single material based on customer?

    Hi All,
    How to create a Platinum,Gold and Silver Customer and how to set different price for a single material based on customer?
    Assume Material is Pen.
    While creating Sales Order in VA01 how to bring different price for the same material for Platinum,Gold and Silver Customers.
    Kindly help me out.
    Thanks,
    Renjith Jose

    A good place to start is http://www.javaworld.com/javaworld/javatips/jw-javatip34.html
    Also, do a search in this forum on HttpURLConnection. That class allows you to use POST method to send form data to a web server.
    "Hidden" variables are only hidden in HTML. The HTTP that gets POSTed to the web server doesn't distinguish between hidden and not hidden. That is, the content you would write to the HttpURLConnection.getOutputStream() would be something like:
    hidden=1&submit=ok(Of course, the variable names would depend on what the web server was expecting from the form.)
    Also, be sure to set the Content-Type request parameter to "application/x-www-form-urlencoded"

  • How to set background color for selected days in DateChooser

    How to set background color for selected days. I created
    checkbox for each day [Son,Mon,Tue,Wed,Thu,Fri,Sat] and a
    DateChooser, I want to change the background color for the selected
    day when i click on a button after selecting the desired checkboxs
    [ monthly wise/yearly wise]
    Thanks in advance

    There is no button involved in the following code, but it may
    be of use to you:
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="init()">
    <mx:Script>
    <![CDATA[
    private var origColor:uint;
    private function init():void {
    origColor = dc.getStyle("selectionColor");
    public function setBackGrdColors(newColor:uint):void {
    dc.setStyle("selectionColor", origColor);
    if(dc.selectedDate){
    var dayOfWeek:Number = dc.selectedDate.day;
    else{
    return;
    switch(dayOfWeek) {
    case 0:
    if(sun.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 1:
    if(mon.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 2:
    if(tue.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 3:
    if(wed.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 4:
    if(thu.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 5:
    if(fri.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 6:
    if(sat.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    default:
    break;
    ]]>
    </mx:Script>
    <mx:VBox horizontalAlign="center" verticalGap="20">
    <mx:DateChooser id="dc" textAlign="left"
    change="setBackGrdColors(cellColor.selectedColor)"/>
    <mx:HBox width="100%" horizontalAlign="center">
    <mx:CheckBox id="sun" label="Sun"/>
    <mx:CheckBox id="mon" label="Mon"/>
    <mx:CheckBox id="tue" label="Tue"/>
    <mx:CheckBox id="wed" label="Wed"/>
    </mx:HBox>
    <mx:HBox width="100%" horizontalAlign="center">
    <mx:CheckBox id="thu" label="Thu"/>
    <mx:CheckBox id="fri" label="Fri"/>
    <mx:CheckBox id="sat" label="Sat"/>
    </mx:HBox>
    <mx:HBox width="300" horizontalAlign="center">
    <mx:Label text="Background Color" />
    <mx:ColorPicker id="cellColor"
    selectedColor="#FF00FF"/>
    </mx:HBox>
    </mx:VBox>
    </mx:Application>

  • HT5622 hi. i bought iphone 5 witch was locked, i made factory reset and now phone asking apple ID and pasword witch i dont know. i was writing to seller but he is not answering me. how to set new account for my iphone 5 what i could use it?

    hi. i bought iphone 5 witch was locked, i made factory reset and now phone asking apple ID and pasword witch i dont know. i was writing to seller but he is not answering me. how to set new account for my iphone 5 what i could use it?

    The iPhone has a feature called "Activation Lock" described here:
    http://support.apple.com/kb/PH13695
    Without that Apple ID, you will not be able to use that iPhone.

Maybe you are looking for

  • FCP sooo slow to open

    Hi, I am running FCP v5.1.2 on a Mac Pro 2.66 with 5gb of ram and if I have closed it with a project open it can take up to 5 minutes to open. It happens with all projects. The bigger the project the longer it takes. I saw this on my old g5 to. Anyon

  • Apple Stockholder discount for new computer purchase

    I want to purchase a new iMac to replace an old G5. I am a stockholder and wonder if Apple offers any discount to stockholders when ordering a new Apple computer?

  • Packaging in oracle lite webtogo 5.0.0..urgen

    I want to use webtogo for my application to work online/offline.. i am trying to use the packaging wizard for publishing all the objects to the mobile server. i have succeeded in publishing all my jsp's, servlets, beans and tables and sequences and v

  • Generic delta extraction using function module

    Hi. I have a generic datasource , extraction being performed by a function module. The extraction works fine in full update mode. The extract structure has a timestamp field. I have enabled generic delta using this field(i.e., marked this field in RS

  • How do i delete everything on my desktop like it was brand new

    How Do I Reboot My desktop?