How do I get the active field of DateEditor in JSpinner?

Hi Everybody,
I have a JSpinner which uses a DateEditor and displayes the date in "dd/MM/yyyy" format in it. I have over ridden the default behaviour of Up and Down arrow button components of it as per my requirements. Now I want to extend the functionality to change the value of the date on the basis of what is the highlighted field.
ie if the month is highlighted then the day and year need to
remain the same but month should increase.and if day is higlited it
shud follow the normal pattern and if year is highlighted the year should
move forward keeping the month and date same (no doubt after 12 months increment it is supposed to go to next year). Here is my code:
<code>
bq. import java.awt.BorderLayout; \\ import java.awt.Component; \\ import java.awt.event.KeyEvent; \\ import java.awt.event.KeyListener; \\ import java.awt.event.MouseAdapter; \\ import java.awt.event.MouseEvent; \\ import java.awt.event.MouseListener; \\ import java.text.SimpleDateFormat; \\ import java.util.Calendar; \\ import java.util.Date; \\ import java.util.GregorianCalendar; \\ import java.util.StringTokenizer; \\ import javax.swing.JFrame; \\ import javax.swing.JPanel; \\ import javax.swing.JSpinner; \\ import javax.swing.SpinnerDateModel; \\ import javax.swing.SpinnerModel; \\ /** \\ * \\ */ \\ /** \\ * @author asmarwal \\ * \\ */ \\ public class MySpinnerDemo extends JPanel implements MouseListener { \\ static JPanel myPanel; \\ static int day = 0; \\ static int month = 0; \\ static int year = 0; \\ static String date; \\ static JSpinner.DateEditor de = null; \\ static Calendar calendar = Calendar.getInstance(); \\ public MySpinnerDemo(){ \\ // Let's see it later if we need to do sth here \\ myPanel = new JPanel(new BorderLayout()); \\ } \\ private static JSpinner getSpinner(){ \\ // initDate, earliestDate & latestDate might be taken from constructor too \\ Date nowDate = calendar.getTime(); \\ calendar.add(Calendar.YEAR, 0); \\ Date earliestDate = calendar.getTime(); \\ Calendar latestCal = new GregorianCalendar(9999, Calendar.DECEMBER, 31); \\ Date latestDate = latestCal.getTime(); \\ System.out.println("InitDate:: "+nowDate+"\n Earliest Date:: "+earliestDate+"\n Latest Date:: "+latestDate); \\ SpinnerModel dateModel = new SpinnerDateModel(nowDate, \\ earliestDate, \\ latestDate, \\ Calendar.YEAR);//ignored for user input \\ JSpinner spinner = new JSpinner(dateModel); \\ Calendar currCal = new GregorianCalendar(); \\ spinner.setValue(currCal.getTime()); \\ spinner.setEditor(new JSpinner.DateEditor(spinner, "dd/MM/yyyy")); \\ spinner.setUI(new javax.swing.plaf.basic.BasicSpinnerUI() { \\ protected Component createNextButton() { \\ Component u = super.createNextButton(); \\ u.addMouseListener(new MouseAdapter() { \\ public void mouseClicked(MouseEvent me){ \\ System.out.println("You have just clicked the up arrow button of UI component..."); \\ calendar.add(Calendar.DATE, 1); \\ spinner.setValue(calendar.getTime()); \\ myPanel.repaint(); \\ } \\ }); \\ return u; \\ } \\ //Down Arrow button \\ protected Component createPreviousButton() { \\ Component u = super.createNextButton(); \\ u.addMouseListener(new MouseAdapter() { \\ public void mouseClicked(MouseEvent me){ \\ System.out.println("You have just clicked the down arrow button of UI component... ActiveField:: "); \\ SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); \\ Calendar calToday = new GregorianCalendar(); \\ String calTodaDateStr = sdf.format(calToday.getTime()); \\ String spinnerCurrDateStr = sdf.format(calendar.getTime()); \\ //Checking if spinner's current date value is today's.. \\ // If yes then go to 31/12/9999 else perform normal date decrement \\ if(spinnerCurrDateStr.equalsIgnoreCase(calTodaDateStr)){ \\ System.out.println("IF:: spinnerCurrDateStr: "+spinnerCurrDateStr+" calTodaDateStr"+calTodaDateStr); \\ Calendar newCal = new GregorianCalendar(9999, Calendar.DECEMBER, 31); \\ //    Set the static var calendar's value to the current system date \\ calendar = new GregorianCalendar(); \\ spinner.setValue(newCal.getTime()); \\ }else{ \\ System.out.println("ELSE:: spinnerCurrDateStr: "+spinnerCurrDateStr+" calTodaDateStr"+calTodaDateStr); \\ calendar.add(Calendar.DAY_OF_MONTH, (-1)); \\ spinner.setValue(calendar.getTime()); \\ } \\ myPanel.repaint(); \\ } \\ public void mousePressed(MouseEvent me){ \\ System.out.println("You have just kept pressed the down arrow button of UI component..."); \\ // Don't do anything \\ calendar.add(Calendar.DAY_OF_MONTH, 0); \\ spinner.setValue(calendar.getTime()); \\ myPanel.repaint(); \\ } \\ }); \\ return u; \\ } \\ }); \\ return spinner; \\ } \\ public void mouseClicked(MouseEvent e) { \\ // TODO Auto-generated method stub \\ } \\ public void mouseEntered(MouseEvent e) { \\ // TODO Auto-generated method stub \\ } \\ public void mouseExited(MouseEvent e) { \\ // TODO Auto-generated method stub \\ } \\ public void mousePressed(MouseEvent e) { \\ // TODO Auto-generated method stub \\ } \\ public void mouseReleased(MouseEvent e) { \\ // TODO Auto-generated method stub \\ } \\ /** \\ * @param args \\ */ \\ public static void main(String[] args) { \\ // TODO Auto-generated method stub \\ JFrame frame = new JFrame("JSpinner Sample"); \\ frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); \\ MySpinnerDemo msd = new MySpinnerDemo(); \\ //System.out.println("msd.getSpinner():: "+msd.getSpinner()); \\ myPanel.add(getSpinner(), BorderLayout.CENTER); \\ frame.getContentPane().add(myPanel, BorderLayout.SOUTH); \\ frame.setSize(200, 90); \\ frame.setVisible(true); \\ } \\ }
</code>
Thanks in advance!

Simmi,
    you need to check in SE11(data dictionary) with the specified tachnical names.
comming to selective deletion...
divide the data into segments based on the organizational values.
take the material group. check with any consultant. ask simple qustion how many material group we have?
take the case 5 mat1, mat2, mat3, mat4, mat5. Delete the values based on that. Menas that... entire infocube defined into 5 segments.
Before deleting make sure u have taken correct charecterstic. if you can give us the scenario we can let you know how can we delete the data with out effecting existing business process.
alll the best.
Regards,
Nagesh Ganisetti.

Similar Messages

  • How do I get the activity window in safari 6.0.2?

    How do I get the activity window in safari 6.0.2?

    Safari 6
    Activity Window is no more available in Safari 6.
    Apple removed that feature.
    Best.

  • How can I get the "text" field from the actionEvent.getSource() ?

    I have some sample code:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.ArrayList;
    public class JFrameTester{
         public static void main( String[] args ) {
              JFrame f = new JFrame("JFrame");
              f.setSize( 500, 500 );
              ArrayList < JButton > buttonsArr = new ArrayList < JButton > ();
              buttonsArr.add( new JButton( "first" ) );
              buttonsArr.add( new JButton( "second" ) );
              buttonsArr.add( new JButton( "third" ) );
              MyListener myListener = new MyListener();
              ( (JButton) buttonsArr.get( 0 ) ).addActionListener( myListener );
              ( (JButton) buttonsArr.get( 1 ) ).addActionListener( myListener );
              ( (JButton) buttonsArr.get( 2 ) ).addActionListener( myListener );
              JPanel panel = new JPanel();
              panel.add( buttonsArr.get( 0 ) );
              panel.add( buttonsArr.get( 1 ) );
              panel.add( buttonsArr.get( 2 ) );
              f.getContentPane().add( BorderLayout.CENTER, panel );
              f.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              f.setVisible( true );
         public static class MyListener  implements ActionListener{
              public MyListener() {}
              public void actionPerformed( ActionEvent e ) {
                   System.out.println( "hi!! " + e.getSource() );
                   // I need to know a title of the button (which was clicked)...
    }The output of the code is something like this:
    hi! javax.swing.JButton[,140,5,60x25,alignmentX=0.0,alignmentY=0.5,
    border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@1ebcda2d,
    flags=296,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,
    disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,
    right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=true,
    rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=first,defaultCapable=true]
    I need this: "first" (from this part: "text=first" of the output above).
    Does anyone know how can I get the "text" field from the e.getSource() ?

    System.out.println( "hi!! " + ( (JButton) e.getSource() ).getText() );I think the problem is solved..If your need is to know the text of the button, yes.
    In a real-world application, no.
    In a RW application, a typical need is merely to know the "logical role" of the button (i.e., the button that validates the form, regardless of whether its text is "OK" or "Save", "Go",...). Text tends to vary much more than the structure of the UI over time.
    In this case you can get the source's name (+getName()+), which will be the name that you've set to the button at UI construction time. Or you can compare the source for equality with either button ( +if evt.getSource()==okButton) {...}+ ).
    All in all, I think the best solution is: don't use the same ActionListener for more than one action (+i.e.+ don't add the same ActionListener to all your buttons, which leads to a big if-then-else series in your actionPerformed() ).
    Eventually, if you're listening to a single button's actions, whose text change over time (e.g. "pause"/"resume" in a VCR bar), I still think it's a bad idea to rely on the text of the button - instead, this text corresponds to a logical state (resp. playing/paused), it is more maintainable to base your logic on the state - which is more resilient to the evolutions of the UI (e.g. if you happen to use 2 toggle buttons instead of one single play/pause button).

  • How do I get the activation serial number for

    I've downloaded Photoshop CS6 Extended trial version. How do I get the activation serial number for this software

    You will need to buy the software.

  • PPD field grayed out.....How do I get the PPD field populated?  Windows 7 x64

    I have an employee running Illustrator in the Creative Cloud and for whatever reason her PPD field is grayed out when she goes to print.  My other two employees running this both have the Fiery file for the printer we have as an option.  Any idea how I can get the PPD field populated?

    Permissions issues on the PPD files or the printer... Or the driver has never been fully installed in the first place due to whatever technical or again permissions issues...
    Mylenium

  • How do I get the activity bar back in Lion Mail 5.3

    I  tried installing mountain lion unsuccessfully over Lion on my 27" imac (16 gb RAM) i7 quad core, 2012 model.  I couldn't do anything to make it load.  It would say installation finished but upon startup the grey screen with rotating circle never quit.  I finally gave up and restored it from time machine to Lion.  A couple days ago I decided to give it another try, this time with maverick with all the same problems.  Again another 2 days spend restoring to Lion but this time I had a lot of trouble with my mail not working when I got done.  After a lot of work-arounds I got it working except for one thing.  On the left side of my mail screen there is lists of all my mailboxes and at the bottom a little square labeled (Activity) and in that area I always get a blue bar showing the progress of an email being sent, and also the progress of one coming in.  I get the one coming in, but no bar for the outgoing mail and can't figure out how to get it to work.  I also never see the "outbox" listed when sending a large file anymore.  Anybody else see this and have an answer?  I thought about reinstalling mail but the Lion installer only has mail 5.0 and it's been updated to 5.3 so after using Pacifist to extract it, it won't restore.  I was wondering if the new mail 7.0 inside of Maverick would install in Lion?

    There are many threads on this, some prefer the grey look, others like don't.
    If you still have a backup of the old Aperture you can extract the colored icons from the Resources folder in the Aperture application package and exchange them, but this is a risky operationa nd you will have to do it over and over again, see this discussion:
    Re: Have today loaded the 3.3 up date on Aperture. After the up date the colour of the Menu Bar and all icons showing projects / albums etc are now grey. Any thoughts on how to reestablish the colours.
    Regards
    Léonie

  • How do I get the address field to show (again) at the top of the page????

    I was messing around with stuff I don't understand, and managed to make the web address field disappear from the top of the page....now I've got only a page title in a gray field. Help! (please). I can't figure out how to get the address to appear again.
    I'm stuck and can't surf

    View menu...  try either "Show Toolbar" or "Customize Toolbar..."
    charlie

  • How do you get the custom fields added to a address book to show up on Pages 09 when merging fields?

    I created some custom fields in the address book and want to get them merged into a Pages 09 document.  When using the merge fields feature in Pages, only the standard fields are displayed.  I am looking for a way to have the custom fields from the address book inserted into the document.

    I believe you will find them if you go to table - unhide all columns.  When you drag and drop card(s) into pages, it automatically shows default fields.  The others are there but hidden.  I hope this works for you!

  • How can I Get the Active window

    I used the following code.. but i didn't get activewindow..
    int hwnd = OS.GetDesktopWindow();
    it returns value and working..
    but
    int hwnd = OS.GetActiveWindow();
    it returns 0 only.. i didn't get correct value...
    how can i get Activewindow .... is there any alternate method....
    import java.awt.image.*;
    import javax.imageio.*;
    import java.awt.Rectangle;
    import java.lang.*;
    import org.eclipse.swt.*;
    import org.eclipse.swt.graphics.*;
    import org.eclipse.swt.internal.win32.*;
    import org.eclipse.swt.internal.*;
    import org.eclipse.swt.widgets.Tracker;
    try
    //in hwnd=OS.GetDesktopWindow();
              int hwnd =OS.GetActiveWindow();
                   System.out.println(hwnd);
              RECT clientRect= new RECT();
              POINT pt1 = new POINT ();
              POINT pt2 = new POINT ();
              OS.GetClientRect(hwnd, clientRect);
              pt1.x = clientRect.left;
              pt1.y = clientRect.top;
              pt2.x = clientRect.right;
              pt2.y = clientRect.bottom;
              System.out.println(clientRect.left);
              System.out.println(clientRect.top);
              System.out.println(clientRect.right);
              System.out.println(clientRect.bottom);
              OS.ClientToScreen (hwnd, pt1);
              OS.ClientToScreen (hwnd, pt2);
              clientRect.left = pt1.x;
              clientRect.top = pt1.y;
              clientRect.right = pt2.x;
              clientRect.bottom = pt2.y;
              System.out.println(clientRect.left);
              System.out.println(clientRect.top);
              System.out.println(clientRect.right);
              System.out.println(clientRect.bottom);
         if((clientRect.right!=0)&&(clientRect.bottom!=0))
         BufferedImage screencapture = new Robot().createScreenCapture(new Rectangle(clientRect.left,clientRect.top,
    clientRect.right,clientRect.bottom));
    File file = new File("screencapture.jpg");
    ImageIO.write(screencapture, "jpg", file);
    System.out.println("Image Saved Successfully");
    else
    System.out.println("Failed");
         catch(AWTException ae){}
         catch(IOException ie){}

    This is not SWT forum.

  • TS4242 how can I get the activation server to activate my phone?All of this happened because I accidently presed the voice over setting and it changed to that in the phone and my password wasnt working so I had to restore the phone to factory settings and

    My iphone will not activate,it keepos sending me a message telling me the servers are down and I tried everything.somebody please help

    Either your antivirus/firewall is blocking access to gs.apple.com, your iphone is jailbroken, or your computer was used at some time in the past to hack or jailbreak this or some other iOS device. The first you can fix by disabling your security software. The 2nd you can't do anything about, and the 3rd you fix by editing your hosts file and removing the lines containing gs.apple.com.

  • How to get the activity of a user?

    Hi Experts,
    How can we get the activity of a user i.e. Which transaction a particular user has gone or some activity log on a particular date? Any table, FM or Tcode. I have already checked the STAD and SM20 transactions. Some authorization problem. So anything except these Tcodes would be helpful. Thanks in advance.
    Regards,
    Prashant.

    >
    santhosh kumar wrote:
    > Hi,
    >
    > I guess if it is not updated or traced under STAD means, i.e. related to authorization failures etc.. kind of stuff will be saved at runtime only in the SAP memory.
    >
    > As it is stored in the buffer, can not be traced in any of the transaction.
    > You should request the user to save and send the screen shot of the SU53 of the user whenever he gets some authorization issue.
    >
    > Based on that, by looking into the SUIM transaction, it can be known whether he is authorized or not, which roles have been assigned etc.. kind of details.
    >
    > Regards,
    > Santhosh.
    Hi Santosh,
    Actually I am doing a root cause analysis for which I need to know whether a particular user has used a particular TCode. I guess the STAD will display only the current data, is there a TCode to display historical data related to user accessing a particular data. Note: I don't have basis authorization.
    Regards,
    Prashant

  • Getting the active role of an user in a trigger

    Hello forum!!
    I've been searching to find out if and how I can get the active role of an user when programming a trigger.
    Unfortunately I did not succeed in finding some information about this. Is it possible? If yes, how?
    Thanks for any hint regarding this topic.
    Sebastian

    Thanks for the answers. This helped a lot but it does not seem to work within my triggers.
    CREATE OR REPLACE TRIGGER InscriptionsInsert BEFORE INSERT OR UPDATE ON Inscriptions
      FOR EACH ROW
      DECLARE
        active_role VARCHAR2(11);
      BEGIN
        SELECT role INTO active_role FROM session_roles WHERE role != 'CONNECT';
        IF :new.ni < 1000 AND active_role = 'ind_service' THEN
          RAISE(ABORT, 'le service individuelle ne peut pas faire les inscriptions pour des sportifs');   
        END IF;
        IF :new.i >= 1000 AND active_role = 'eq_service' THEN
          RAISE(ABORT, 'le service equipe ne peut pas faire les inscriptions pour des equipes');   
        END IF;
      END;
    CREATE OR REPLACE TRIGGER ResultatsInsert BEFORE INSERT OR UPDATE ON Resultats
      FOR EACH ROW
      DECLARE
        forme VARCHAR2(12);
        active_role VARCHAR2(11);
      BEGIN
        SELECT forme INTO forme FROM Epreuves WHERE nEpreuve = :new.nEpreuve;
        SELECT role INTO active_role FROM session_roles WHERE role != 'CONNECT';
        IF forme = 'individuelle' AND active_role = 'eq_service'
          RAISE(ABORT, 'le service equipe ne peut pas enregistre des resultats pour des sportifs');
        END IF;
        IF forme = 'equipe' AND active_role = 'ind_service'
          RAISE(ABORT, 'le service individuelle ne peut pas enregistre des resultats pour des equipes');
        END IF;
      END; 

  • Get the custom fields data at the time of save

    Hi,
    We have added few fields in the ICWC for the complaint screen.
    At the time of save i am trigering a BADI.
    I would like to check the data that is entered in those fields of complaint screen.
    Is there any FM which can be used to get the data from the buffer ?
    I have the header GUID available to me .
    Thanks.
    R

    Hi,
    Let me elaborate a bit.
    Users would create the complaints in the ICWC.We have addeded few custom fields in the complaint screen.
    CRMT_CUSTOMER_H_WRKT is extended with the custom fields.
    At the save i am trigerring the Partner Determination BAdi.
    Here i have the complaint guid at run time.
    I would like to check the data entered in the custom field in the complaint screen. Based on this i would like to determine one more partner.
    My question is how can i get the custom field data in the complaint screen in this BAdi.
    The FM:  CRM_ORDER_READ is not returning this data.Is there any FM to get this ?
    Thanks.
    R.

  • How can we get the value of the key field in a custom data model using governance API?

    Dear Team,
    How can we get the value of the key field in a custom data model, to be used for manipulation of the change request fields using governance API?
    Any kind of help would be sincerely appreciated.
    Thanks & Regards,
    Tushar.

    Hi Michael,
    Thanks for direction. Let me give more context on this as I'm interested to get more details..One of the issue was to read cross entity field values on UI based on user action and set other entity field behaviour...It is similar to what is being posted here.
    For ex: Reading MTART from Basic Data UIBB in MM MDG UI and set the field properties in some other custom entities say ZZETEST. This cannot be done using UI BADI as it only supports single entity at a time and not cross entity. So alternatively we found a solution where we can enhance existing PLMB feederclass cl_mdg_bs_mat_feeder_form by reading the model and the entity as needed as it it proved that it supports cross entity UI field behaviours and so business requirements.
    This is a workaround for now.
    So the question is How do we achive it using governance API for cross entity field behiaviours.?or what is the right way doing this.
    Can we do that using governance API and its' methods?
    In the Governance API doc you provided below has referring to below external model as part of gevernance API.
    The active or inactive data (before or during the derivation or the check) can be read
    with the external data model interface IF_USMD_MODEL_EXT with the method READ_CHAR_VALUE and
    the corresponding READ_MODE parameter. To avoid unnecessary flushes (derivations), the NO_FLUSH
    parameter should b
    e set to ‘X’.
    Thanks
    Praveen

  • EBS field how can we get the information that on which form this filed is

    we are doing some data mapping activity for datawarehousing if we are given some EBS field how can we get the information that on which form this filed is located is there any good method

    Hi Kapoor,
    please give also others a chance, and excuse that I get up late on vacation ;-)
    Anyway, I'd keep the story creation responder to recognize the copy, then combine it with an observer on the backing xml story to catch the associated XML element which is created there. Something like below:
    UIDRef xmlStoryRef = Utils<IXMLUtils>()->GetBackingStore(doc);
    InterfacePtr<ISubject> subject ( xmlStoryRef,IID_ISUBJECT );
    subject->AttachObserver(observer,IID_IIDXMLELEMENT,observer->GetAttachIID());

Maybe you are looking for

  • Runtime errors in BPM

    Hi all, We have a transformation step that is generating mapping errors at runtime. We do not see alerts generated by default on the alert framework for these errors. Is this expected? Should we be implementing the alert generation specifically insid

  • Can't re-order my queue on Netflix and keep losing the connection

    I'm having so much trouble with Netflix!  I can't re-order my queue, I keep losing the connection, and it's painfully slow. Is Netflix known to be unstable on iPad? Other internet connecitons seem to be fine. 

  • KH399 selection is not possible at this level

    Hi Experts, I am facing error while executing COPA Report KE30, which created by KE94 line item report. please help me on that. Regards, Ram

  • Deadline Monitoring for Decision

    HI all, I have taken a Decision Step in my workflow and on Latest End Tab specified 1 minute  and in Action as Modeled.and specied the step number which i want to execute after deadline is missed. The problem is After 1 Minute it is not going to that

  • Video freezing several times

    I use firefox and i have problems with online videos(from facebook, from sites, from youtube etc) that they using flashplayer. The video freezes several times for 1-3 seconds and the sound keeps playing. But when i watching videos that they use html