Search Results

Search found 2 results on 1 pages for 'user542719'.

Page 1/1 | 1 

  • Button inside text box

    - by user542719
    My code shows a button inside a textbox, but when the input value changes, the size of the text box also changes. That I don't like. Is there any solution such that the textbox size remains fixed? Or any other idea on how to create a button inside textbox? The following is my code: JPanel panel = new JPanel(); panel.setLayout( new FlowLayout(FlowLayout.CENTER, 0, 0) ); panel.add(textField); panel.add(button); panel.setBackground( textField.getBackground() ); panel.setBorder( textField.getBorder() ); textField.setBorder(null);

    Read the article

  • static variable lose its value

    - by user542719
    I have helper class with this static variable that is used for passing data between two classes. public class Helper{ public static String paramDriveMod;//this is the static variable in first calss } this variable is used in following second class mathod public void USB_HandleMessage(char []USB_RXBuffer){ int type=USB_RXBuffer[2]; MESSAGES ms=MESSAGES.values()[type]; switch(ms) { case READ_PARAMETER_VALUE: // read parameter values switch(prm){ case PARAMETER_DRIVE_MODE: // paramet drive mode Helper.paramDriveMod =(Integer.toString(((USB_RXBuffer[4]<< 8)&0xff00))); System.out.println(Helper.paramDriveMod+"drive mode is selectd ");//here it shows the value that I need. ..........}}//let say end switch and method and the following is an third class method use the above class method public void buttonSwitch(int value) throws InterruptedException{ boolean bool=true; int c=0; int delay=(int) Math.random(); while(bool){ int param=3; PARAMETERS prm=PARAMETERS.values()[param]; switch(value){ case 0: value=1; while(c<5){ Thread.sleep(delay); protocol.onSending(3,prm.PARAMETER_DRIVE_MODE.ordinal(),dataToRead,dataToRead.length);//read drive mode System.out.println(Helper.paramDriveMod+" drive mode is ..........in wile loop");//here it shows null value }}//let say end switch and method what is the reason that this variable lose its value?

    Read the article

1