Majestics 84 Posting Pro

Sorry, i dont have alot idea, my friend use to program in it... As he want to ask question so i suggested him DANIWEB.... well the question is pretty simple, i want to free up the resource at once when the application close...

Majestics 84 Posting Pro

I didnt mean running, in android a application closing is completly handled by android OS , i windows if we close a program it closes and free up the resource immediatly but in android it dont.... So we can access the application values even the application is shutdown....

Well i think i posted at wrong place, kindly move to mobile development area...

Majestics 84 Posting Pro

Use trim and upper/lower case function also because matching small string with large will always return false event the content are same, also spaces can give problem.

Majestics 84 Posting Pro

I have added tool tip in form of List, and Pop function pop combo box , i dont want to pop combo box, i want to pop its tool tip.....

Majestics 84 Posting Pro

As transferaccount_id is string then use string function to compare and thats equals function

if(name.equals("String you want to match");
Majestics 84 Posting Pro

SIMPLE LOOP PROBLEM.................. Let ME just help you with one

for i 1 to 5
{
for j i to 5
{
print i
}
nextline
}
Majestics 84 Posting Pro

As the title stated i want to show tooltip when the user press up and down keys in combo box, Please any hint ..... Regarding to problem

Majestics 84 Posting Pro

Robot class to create robotic function of mouse, keyboard and screen... For executing a command or function you can use Runtime class.

http://download.oracle.com/javase/1.4.2/docs/api/java/lang/Runtime.html

Majestics 84 Posting Pro

If there are more then one word, y dont u use InputdialogBox or textfield?

Majestics 84 Posting Pro

http://download.oracle.com/javase/1,5.0/docs/api/java/util/Scanner.html

You can use Scanner Class for console inputs

http://www.java2s.com/Code/JavaAPI/javax.swing/JOptionPaneshowInputDialogObjectmessage.htm

You can use JOPTIONPANE INPUT DIALOG FOR GUI... Also u can use text fields, area many more things but for starter its easy.

Majestics 84 Posting Pro
frame.setVisible(true);
Graphics g = canvase.getGraphics();
g.drawRect(0,0,50,50);

Getgraphics take graphics when frame is visible, You just have to get graphics after setting it visible.... Simple Solution :)

Majestics 84 Posting Pro

Well its java section of the forum.... Secondly i have already tried the method, check my question....

Majestics 84 Posting Pro

How to set white back ground for disabled combo box???

I already tried setBackground.... But it didnt work like textfields.

Majestics 84 Posting Pro

Sorry, One of my best friends ask this question from me.... I just want to know the solution. As i have already used android so i know its closely related with java... Almost syntax is java... So any java programmer may have its idea, because its a emerging language....
:)

Majestics 84 Posting Pro

Can we handle of android app by ourself rather then android handling it itself?

Anuradha Mandal commented: N/A. +0
Majestics 84 Posting Pro

Check this out... Its perfect Example

import java.awt.event.*;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import javax.swing.*;
import javax.swing.text.*;

/* This work is hereby released into the Public Domain.
 * To view a copy of the public domain dedication, visit
 * http://creativecommons.org/licenses/publicdomain/
 */
public class AutoCompletion extends PlainDocument {
    JComboBox comboBox;
    ComboBoxModel model;
    JTextComponent editor;
    // flag to indicate if setSelectedItem has been called
    // subsequent calls to remove/insertString should be ignored
    boolean selecting=false;
    boolean hidePopupOnFocusLoss;
    boolean hitBackspace=false;
    boolean hitBackspaceOnSelection;
    
    KeyListener editorKeyListener;
    FocusListener editorFocusListener;
    
    public AutoCompletion(final JComboBox comboBox) {
        this.comboBox = comboBox;
        model = comboBox.getModel();
        comboBox.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                if (!selecting) highlightCompletedText(0);
            }
        });
        comboBox.addPropertyChangeListener(new PropertyChangeListener() {
            public void propertyChange(PropertyChangeEvent e) {
                if (e.getPropertyName().equals("editor")) configureEditor((ComboBoxEditor) e.getNewValue());
                if (e.getPropertyName().equals("model")) model = (ComboBoxModel) e.getNewValue();
            }
        });
        editorKeyListener = new KeyAdapter() {
            public void keyPressed(KeyEvent e) {
                if (comboBox.isDisplayable()) comboBox.setPopupVisible(true);
                hitBackspace=false;
                switch (e.getKeyCode()) {
                    // determine if the pressed key is backspace (needed by the remove method)
                    case KeyEvent.VK_BACK_SPACE : hitBackspace=true;
                    hitBackspaceOnSelection=editor.getSelectionStart()!=editor.getSelectionEnd();
                    break;
                    // ignore delete key
                    case KeyEvent.VK_DELETE : e.consume();
                    comboBox.getToolkit().beep();
                    break;
                }
            }
        };
        // Bug 5100422 on Java 1.5: Editable JComboBox won't hide popup when tabbing out
        hidePopupOnFocusLoss=System.getProperty("java.version").startsWith("1.5");
        // Highlight whole text when gaining focus
        editorFocusListener = new FocusAdapter() {
            public void focusGained(FocusEvent e) {
                highlightCompletedText(0);
            }
            public void focusLost(FocusEvent e) {
                // Workaround for Bug 5100422 - Hide Popup on focus loss
                if (hidePopupOnFocusLoss) comboBox.setPopupVisible(false);
            }
        };
        configureEditor(comboBox.getEditor());
        // Handle initially selected object
        Object selected = comboBox.getSelectedItem();
        if (selected!=null) setText(selected.toString());
        highlightCompletedText(0);
    }
    
    public static void …
peter_budo commented: Thanx for sharing +16
Majestics 84 Posting Pro

then use ||(Or Statement) and use them as well.....

Majestics 84 Posting Pro

Reason this error is coming is u have button with action listener too
You simply have to use if code to enclose line 301 statement ,

if(source is equal to combo box then)

Right now even a button is pressed that code is executed which is creating a cast problem from button to combo box... Hope this help.

Majestics 84 Posting Pro

Check setPreferredSize function.

Majestics 84 Posting Pro

u must use os.equals("");

Its a method for string.

Majestics 84 Posting Pro
UIManager.put("ToolTip.foreground", new ColorUIResource(Color.WHITE));
		UIManager.put("ToolTip.background",new ColorUIResource(176,23,31));
		UIManager.put("ToolTip.font",	new FontUIResource(Font.SANS_SERIF,Font.BOLD,16));

We can use to change fonts , fore groud, background and border without sub classing JToolTip...
Just Write before setting ToolTip for any component.

Majestics 84 Posting Pro
puzzle[i][j]

For accessing specific index u have to specify its index location...

in loop it will print
puzzle[0][0]
then
puzzle[0][1]
and so on....

Majestics 84 Posting Pro

Classic Windows Windows

As it is written here Classic look and feel is for windows then it mean all windows? Some thing is confusing me is the support for classic l&f in windows 7, please just yes/no will be enough for helping me.

Majestics 84 Posting Pro

Thanx It solved my problem....

Majestics 84 Posting Pro

I m using windows vista, and i have set l&F of my app "classic look and feel", which is fixed, as windows seven doesnt have classic theme , will java "classic look and feel" work on windows 7? If not then how can we make it work? :)

Majestics 84 Posting Pro

I want to create a tool tip which has fix rectangular size and show custom font's...
Any tips or link or any material to start with?

Majestics 84 Posting Pro

Oh... I simply want this

----------------------
a
----------------------
a
ab
abc
abcd

-----------------------
ab
-----------------------
ab
abc
abcd

Consider two line a combo box and when i enter "a" all hints regarding to "a" comes , when i proceed to "ab" hints referesh and filter suitable data..

:) Similar when i press back space... Its a normal google search box. But no autocomplete.

Majestics 84 Posting Pro

Well i now i m trying to create my own jcombo box with edit feature

set key listener
if keys are type able then
take the char and search in the combo box and pop combo box

Problem is in jcombo box how can i know that what user has pressed previosuly....

I mean i can record each char on its turn but not before that char... Any idea...

Simple Example is if user press a b c , how to get a when user press b because we cant get text in jcombo box....

Majestics 84 Posting Pro

Create Autorun.inf file , it will execute when ur drive got accessed. But for java you must have jdk kit.

Majestics 84 Posting Pro

Well @mKorbel i didnt thought that way too.... :) I have developed a easy algorithem to do it without extra work. Clean and clear code....

Majestics 84 Posting Pro

Its a simple program but you have to try first we dont create assignments.
Algorithem will be like this

define array of int for age
define array of string for gender
loop 45 times to get all data
loop 45 times with if condition to check age between 8 to 12 in array and display it.
Majestics 84 Posting Pro

Is there any method in java to know size of decimal??
I mean 14 has 2 digits , 100 has 3 etc.......

I m going to implement auto generated number like
A0001 , now i want to change it on each new entry , so Does any one has any great idea???

Auto generated number length remain fix...

Majestics 84 Posting Pro

http://www.java2s.com/Code/Java/Swing-Components/AutocompleteComboBox.htm

I have used the example listed here. It work fine upto 100 items. but when i increase items to 1000 or above it speed get super slow, even my processor is 2.66 C2Q , so what i will expect from pentium 4 having 512 ram ... Major issue is performance... Any idea to enhance it????

And thank you for the above link...... You are a nice friend of mine... In todays world people like you are very rare...

Majestics 84 Posting Pro

//--------- When Course Matches break from for loop else it will make matched again false.

if (courseObjects[i].equals(tempCourse))
{
matched = true; //Matched Course Code
break;
}
Majestics 84 Posting Pro

Thank you... But i found a better method.

Majestics 84 Posting Pro

I have googled alot exampled to create auto complete jcombo box, found many libraries also codes but they are pretty much complex, has any one idea to create this as easy as possible????

Majestics 84 Posting Pro

A string buffer is like a String, but can be modified. At any point in time it contains some particular sequence of characters, but the length and content of the sequence can be changed through certain method calls.

http://download.oracle.com/javase/1.5.0/docs/api/java/lang/StringBuffer.html

Majestics 84 Posting Pro

I have forgot my sqlserver 2000 password, any method to recover it???????

Majestics 84 Posting Pro
Add them in a panel
public mypanel extends JPanel
{
Set Layout...
add combobox
add list
setBorder
}

Simple and easy Algorithem.

Majestics 84 Posting Pro

How to add serial number like column in jtable at left side of jtable?

Majestics 84 Posting Pro
catch (SQLException ex) {
return false;
}

Add this and try again. As ur catch exception dont have return thats y u are encountering this error.

Majestics 84 Posting Pro

The Solution for above problem is

Locale.setDefault(new Locale("es","ES"));

Sorry i was too hasty for getting solution so i asked the question... I have found the solution , hope moderators dont mind....

Majestics 84 Posting Pro

I have encountered ORA 00604 Error, while i was accessing database from my app over Vista system over network, it runs ok on database system... Can any one help me please finding out the solution.

Majestics 84 Posting Pro

The problem was i made three projects in java before this current project, so i used system feel and look setting which changes with the feel and look of the windows, now in this project i created some custom buttons and panels which are not compaitable with xp feel and look , which is problem so i m thankful to @Ezzaral which helped me remembering back that solution....
I also want to know the api for this solution but as windows is common in third world countries because of piracy no one use linux , even linux users are call ... here(Not my opionion).... I love linux my self , rest you can understand yourself..

Majestics 84 Posting Pro

Thats what i m searching too @peter_budo, but i didnt got any library regarding to it... So i thought asking over the forum can solve my problem... Okay if its not posible can we remove border of "button" in windows xp look and feel. I used windows classic and windows xp look and feel , in classic buttons border are not visible.. I have used

setBorder(null);
setFocusPainted(null);
setOpaque(false);

But it only work under windows classic L& F. Any Idea, I m in the middle of the project.... :(

Majestics 84 Posting Pro

How to keep look and feel of java program as classic windows style , even the style of the windows change to windows xp look, or aero look? I mean permenantly keeping classic look? Has any one has any idea? Thank you............... for any advice , help... :)

Majestics 84 Posting Pro

Yup I agree with @Ezzaral, You must create seperate functions for each of the code which are executing under cases... and call both function in case 3. :)

Majestics 84 Posting Pro

Switch statement is made to reduce if else statment, as u have only few condition ,y dont u use if else rather then switch... Still u want to use switch the in case 3 write both code of case 1 and case 2.

Majestics 84 Posting Pro

Why dont u try bluetooth......

Majestics 84 Posting Pro
CASE 3:
CASE 5: fucntion();

This is the method for multiple choice in switch.