Enabling button from other file/screen

I have a start screen with a button that is enabled by default. To enable it, login is required. When u click login button, it opens a new screen/java file. I verify acc. ID and psswd there. Can i also enable the button on the main window from the login window?
When i try ManageDB(name of main).btnView.setEnabled(true) i get non-static context error.

Seems like the first thing you'ld show is a logon screen, unless you had a splash screen also. If you want to show the application frame first with buttons disabled then that's up to you. Logon windows are usually modal dialogs. So display the modal dialog, validate username and password, then close the dialog, then get what you need from the dialog in order to determine if the button on the main frame should be enabled, then dispose of the dialog. It's pretty simple really but if you're having "static" problems then that's another issue alltogether.
here's what you need to know about dialogs.
http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html
kind regards
walken

Similar Messages

  • How to call this out by clicking button from other file??

    The following coding is easy and workable...!! i wonder how do i call this out by clicking button from other file... please help!!
    import java.awt.geom.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import java.awt.print.PrinterJob;
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.print.*;
    public class Receipt extends JPanel implements Printable, ActionListener {
    final static Color bg = Color.white;
    final static Color fg = Color.black;
    final static Color red = Color.red;
    final static Color white = Color.white;
    final static BasicStroke stroke = new BasicStroke(2.0f);
    final static BasicStroke wideStroke = new BasicStroke(8.0f);
    final static float dash1[] = {10.0f};
    final static BasicStroke dashed = new BasicStroke(1.0f,
    BasicStroke.CAP_BUTT,
    BasicStroke.JOIN_MITER,
    10.0f, dash1, 0.0f);
    final static JButton button = new JButton("Print");
    public Receipt() {
         setBackground(bg);
    button.addActionListener(this);
    public void actionPerformed(ActionEvent e) {
    if (e.getSource() instanceof JButton) {  
    PrinterJob printJob = PrinterJob.getPrinterJob();
    printJob.setPrintable(this);
    if (printJob.printDialog()) {
    try {
    printJob.print();
    catch (Exception ex) {
    ex.printStackTrace();
    public void paintComponent(Graphics g) {
         super.paintComponent(g);
         Graphics2D g2 = (Graphics2D) g;
         drawShapes(g2);
    public void drawShapes(Graphics2D g2){
    g2.drawString("Hello world",50,50);
    public int print(Graphics g, PageFormat pf, int pi) throws PrinterException {
    if (pi >= 1) {
    return Printable.NO_SUCH_PAGE;
         drawShapes((Graphics2D) g);
    return Printable.PAGE_EXISTS;
    public static void main(String s[]){
         JFrame f = new JFrame();
         JPanel panel = new JPanel();
         panel.add(button);
         f.getContentPane().add(BorderLayout.SOUTH, panel);
         f.getContentPane().add(BorderLayout.CENTER, new Receipt());
         f.setSize(580, 500);
         f.show();

    The following coding is easy and workable...!! i wonder how do i call
    this out by clicking button from other file... please help!!Copy the code from your main() method and put it into the actionPerformed() method of the other class. If you do not need to reference the instance of Receipt from the othe class, it is that easy.

  • How can I remove the Emergency Call button from the lock screen Xperia Z2

    How can I remove the Emergency Call button from the lock screen on my Z2 phone

    Alecuk wrote:
     It's like the stupid bold font on the hours or the lock screen clock - i've never seen anything so stupid in all my life.
    it's things like this that make a good phone c.r.a.p.
    Hi, well if you do a little bit of research on the forum you will be able to see that you can & very easily able to change the font on the clock 

  • I migrated all data from old PC to new and iTunes successfully transferred to new PC. When I click on a song it says it cannot locate the original. How does one map iTunes file to iMusic to enable play from original files ?

    Subject: Migration
    I migrated all data from old PC to new and iTunes successfully transferred to new PC. When I click on a song it says it cannot locate the original. How does one map iTunes file to iMusic to enable play from original files ?

    Subject: Migration
    I migrated all data from old PC to new and iTunes successfully transferred to new PC. When I click on a song it says it cannot locate the original. How does one map iTunes file to iMusic to enable play from original files ?

  • Adding a URL button from XML file

    I'm making a photo slideshow that pulls info from an XML
    doc--including a URL. What is the code to add a link on a Flash
    button from an XML document?
    Here's my XML code for each photo: <url>
    http://www.yahoo.com</url>
    My Flash doc pulls all xml url's in an array like this:
    function loadXML(loaded) {
    if (loaded) {
    xmlNode = this.firstChild;
    image = [];
    description = [];
    url = [];
    delay = [];
    total = xmlNode.childNodes.length;
    for (i=0; i<total; i++) {
    image
    = xmlNode.childNodes.childNodes[0].firstChild.nodeValue;
    description
    = xmlNode.childNodes.childNodes[1].firstChild.nodeValue;
    url
    = xmlNode.childNodes.childNodes[2].firstChild.nodeValue;
    delay
    = xmlNode.childNodes.childNodes[3].firstChild.nodeValue;
    }

    Thank you! :)
    Do you happen to know how to open the link into a new browser
    window using the dynamic link? Putting "url" for the url returns a
    browser error "url not found on server".

  • Accesing mxml Button from .as file

    Hello.
    Here's my problem:
    1. i've created new extension project
    2. in mxml design view, i've added 1 button, and gived it an id of "button"
    3. how can i acces that button inside .as file? (i want to add event listeners to it, and change its label);

    Apparently, the correct way is: FlexGlobals.topLevelApplication
    (it seems like FB has some problems with both com.adobe.photoshop.Application and mx.core.Application.application in the same class - at least it fired a bunch of weird errors to me)
    Davide

  • Enable hints in other file types

    Hi I am doing some ASP code tweaks on a CMS skin, and the extention ASCX is used, however when I load it, there are no hints available.
    is there a way to add file extensions to the edge code so I can get hints for other file types than the usual HTM PHP JS etc. ?

    Yes, Edge Code supports extensions.  Here's an extension that will provide generic code hints just listing all the tokens in the current file: https://github.com/bigeyex/brackets-wordhint.  It should work for basically any file type.  This is similar to the simple hinting you get in editors like Sublime or TextMate.  If you're looking for more language-aware code hints, your best bet is to use an ASP-specific IDE like Visual Studio instead.
    - Peter

  • How do I display Canvas Graphic image (Not Iconic button) from jar file

    Hi all,
    I am currently using Forms 10g.
    I have gone through the tutorials on how to add Button Icons into Jar files for web enables forms .....so far so good
    This however does not explain what I actually want to do... since "graphic images are by nature embeded in the for rather than referenced ......so here goes ..
    I have a forms 10g application where all the individual form modules/canvases display a big banner (covering top 20% of the screen). This was done by importing the image straight unto the content canvases. As you know this now becomes a "graphic Image" now embeded(& not referenced by file name) on the canvas. Also bear in mind that this is actually different from an "Image Item" which is a block object.
    I dont know if this is possible, but what steps do i follow to make the image part of a jar file as opposed to my current situation. Please let me know if possible or not so I stop waisting development time looking for answers :)
    Another question is how do i make this jar file a library object so that we can vary the image as we wish
    NB: one other trick which i can think of is to create a giant push button across the screen to display the image and then stick it in a jar file !
    Cheers
    css_jay99

    I don't know about embedded images imported in from the builder, but there is a way to use READ_IMAGE_FILE into a BLOCK.IMAGE_ITEM where the images are all in a jar file stored on the OAS.
    Metalink Note:137397.1 explains it in details.
    Tony

  • How to copy records from 2 file (one file depending from other file)

    In fact I have 2 files orders (1 heading, 1 detail):
    - COM_COMMANDES = heading,
    - COM_COMMANDES_LIGNES = D2TAIL,
    COM_COMMANDES_LIGNES depends on COM_COMMANDES.
    When I make an INSERT INTO in COM_COMMANDES, it makes me creation well.
    On the other hand, when I make an INSERT INTO in COM_COMMANDES_LIGNES, it creates me a recording BUT not with the identifying good (that created in COM_COMMANDES).
    Result: I have well the order copied but without the lines.
    Thank you to help me because I do not manage to regulate this problem.

    Hi,
    I have developed a example form and tested, and its works as your requirement.
    i have created a table with three three fields and the same data as u mentioned in post.
    I the button just paste the code and hope it will work.
    declare
         cursor c_test is select name,city,group_no from TEST_EXAMPLE;
    begin
         go_block('XXNEXTBLK');
    for C_test_rec in C_test
    loop
         :XXNEXTBLK.NAME := C_test_rec.name;
         :XXNEXTBLK.CITY := C_test_rec.city;
         :XXNEXTBLK.GROUP_NO :=C_test_rec.group_no;
         next_Record;
    end loop;
    FIRST_RECORD;
    --go_block('LC_REQ_BLK');
    Exception
         when too_many_rows then
         null;
         when others then
         null;
    end ;
    declare
    cursor c_test1 is select name,city,group_no from TEST_EXAMPLE;     
    begin
         go_block('XXNEXTBLK');
    if :XXNEXTBLK.GROUP_NO =1 then
         last_record;
         create_record;
              for C_test1_rec in C_test1
    loop
         :XXNEXTBLK.NAME := C_test1_rec.name;
         :XXNEXTBLK.CITY := C_test1_rec.city;
         :XXNEXTBLK.GROUP_NO :=C_test1_rec.group_no+1;
         next_Record;
    end loop;
    FIRST_RECORD;
    end if;
    end;
    Check it, if any issue just send a mail to [email protected], ill forward the fmd to you.
    Thanks & Regards
    Srikkanth.M

  • How to remove buttons from a selection-screen as window.

    Hello SAPients.
    I'm using CALL SELECTION-SCREEN 100 STARTING AT 10 10 to call a previously created selection-screen. The window shows 4 buttons: Execute,  Check input, Save as variant and Cancel. The user is asking to remove the Check input and Save as variant buttons. Is that possible? I've been searching and I can't find a way to remove those 2 buttons.
    Thank you in advance for your help.

    Hello Ric,
    The buttons must be defined in GUI status right?
    So you must be calling the 'set pf-status' command?
    Modify this statement.
    suppose the function code for check input is 'CHECK' and save variant is 'SAVE'.
    TYPES: BEGIN OF TAB_TYPE,
            FCODE LIKE RSMPE-FUNC,
          END OF TAB_TYPE.
    DATA: TAB TYPE STANDARD TABLE OF TAB_TYPE WITH
                   NON-UNIQUE DEFAULT KEY INITIAL SIZE 10,
          WA_TAB TYPE TAB_TYPE.
    CLEAR TAB.
    MOVE 'CHECK'TO WA_TAB-FCODE.
    APPEND WA_TAB TO TAB.
    MOVE 'SAVE' TO WA_TAB-FCODE.
    APPEND WA_TAB TO TAB.
    SET PF-STATUS 'STAT' EXCLUDING TAB.
    Thanks,
    Susmitha
    Dont forget to reward points for useful answers

  • How can i open a slide in another file on clicking a button from another file

    Hello guys!
    This is my first post on captivate community. I've sucked into a problem. Is this possible somehow to open a slide in another file while clicking on a button that is in a different file.
    Any help would be appreciated.
    Thanks

    Jim's post might help in this.
    Jump to a Specific Slide in a Course Using Captivate 7 - CaptivateDev.com
    http://captivatedev.com/2011/05/01/how-to-jump-to-a-specific-slide-in-a-separate-course/
    Read through the comments as well. You will generally find useful info there.
    Sreekanth

  • Integrating bookmarks from other files

    I have multiple bookmark files from Firefox and Internet Explorer that I want to integrate into one Safari Bookmark file.
    1. I'm thinking of doing this directly by copying and pasting links and adding the html code into the master file. Are there any issues with doing it this way?
    Thanks.

    Hi
    Simply go to Safari's File Menu>Import Bookmarks. Navigate to your Firefox and IE bookmarks. The bookmarks will now appear as a separate collection in your Bookmarks Manager (command/option/B keys, or click on the Book Icon in the Bookmarks Bar to open). You can either drag/drop, or copy/paste individual bookmarks, or folders from either of those collections to your other collections.
    Firefox's bookmarks are found at Your User Account>Library>Applications Support>Firefox>Profiles>default.tra. In the last folder, select Bookmarks.html.
    I'm not certain of the IE location, however, in your User Library, I believe it is located in the "Favorites folder".

  • Hyperlinks from other file formats working in Pages

    how can I get the hyperlinks in an imported WORD file when it opens on my laptop into a Pages file to open other DOc files in a folder?

    You can't. Pages can only hyperlink to Pages documents. When you open a word document in Pages it becomes a Pages document and isn't a Word document anymore.

  • I recently updated my iPhone's 3GS software to iOS 5.1...Is there any way to remove the camera button from the lock screen?

    Heeelp?!...

    I did just that, good idea.
    I stated in my feedback message that I feel it disturbing that someone handling my iPhone, but not having the passcode, can take photos with my phone.  Photos of --<sigh>--Lord knows what.  While the phone's usually in my pocket or otherwise close to my person, that's not always the case. 
    Now, I'll grant that it is nice to have the option to allow someone to take a photo with my phone without also giving them access to everything else.  In fact, that's a very nice little tidbit.  I'd just like to have the flexibility to prevent people from taking pics with my phone, should they happen to have it in hand and feel the urge to add to my camera roll even without my approval.  There's real opportunity for mischief in this.

  • Why has iOS 7 deleted my picture frame button from my lock screen, and can I get it back?

    Can anyone tell me if I can get picture frame mode back on my ipad? Since downloading iOS 7 it's disappeared :(

    You can't but you can set up a slideshow and your pictures. In that you can pick the pictures that you want, the duration each picture shows, and put it in a loop so it will repeat.

Maybe you are looking for

  • Can't access a portal I need for work!

    I get the following message when I try to access a work portal. "If you are having issues seeing parts of the portal, please use Internet Explorer (with Compatibility View selected) or Firefox as your browser. " Does this mean I can't access it with

  • Change home computer for Ipod touch

    My son has Ip an ipod touch, (purchased last year xmas 2009) think its the 3rd gen. When he got it we had a different computer which he initially logged as his home computer. This has since broke and we brought him a new laptop for xmas. I have autho

  • Problem with maxprocs 1 on Sun One Web server 6.1

    I am using sun one web server on Unix with maxprocs set to 3. This means that there are 3 jvms running my application under 1 instance. However I have certain components like an application cache that I would like to share between these 3 processes.

  • Interfacing to 3rd Party tools from BW

    I realize Open Hub is the SAP solution to interfacing BW data to 3rd Party tools. However does anyone see a problem in general with the approach of developing custom web services on the BW box that would be called by a third party tool and in turn re

  • Customize email body from BPM-Alerts

    Hello, I configured some monitoring for background jobs in BPM (Transaction: DSWP). Now the emails are looking like this (obfuscated the real data): Solution number: xxxxxxx Solution name: xxxxxxxx Process: xxxxxx Process step: xxxxxxxxx System: xxx