Hello guys, am trying to make a drop down menu such that the droped element is static, meaning when i click on <li> the menu shouldnt old but rather remain droped. Currrently with what i have anytime i click on the droped menu item, the droped menu disappears, even when i click on the page's background it disappear's. Will appreciate the help or pointers to related articles. Thanks

i want to know how i can get a json response from my node.js server and display the response on my web page

`

var request = require("request"),
    username = req.body.username,
    password = req.body.password,
    url = "https://api.ecoachsolutions.com/main.php?ecoachsignin=1&server=remote&user="+username+"&pass="+password;

    console.log("url is "+url);
    request.get(
    {
        url : url
    },
    function (error, response, body) {
        // Do more stuff with 'body' here
       if (!error && response.statusCode == 200) {
        var json_body = JSON.parse(body);
        console.log(json_body); 
        var msg = json_body.profile.user;//this is the message i want to show on my web page(msg)
    console.log(msg); // get json response
  }
    }
);`

@peter_budo thanks for the reply but i have been able to get what i wanted

i am designing an android app and in me deisgns there is one with a tabView thats hosts another tabView in one of the tabs. i want to know if there is a way to implement this design please, if yes i would appreciate some suggestions and pointers. below is am image of what i want to acheive thanks.

i have a website which i sell my books on, now i want to redirect my users to the home page (index.html) when they click the download link and the file starts to download.

Will really appreciate the help and support thanks.

this is the php code i wrote

<?php
$fakeFileName= "e-book_mobi.mobi";
$realFileName = "e-book_mobi.mobi";

$file = "book/". $realFileName;
$fp = fopen($file, 'rb');

header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=$fakeFileName");
header("Content-Length: " . filesize($file));
fpassthru($fp);
exit;
?>

this is the download link

<li><a href="mobi_download.php?id=<?php echo $_GET['id']; ?>" target="_blank"/><b>.mobi</b></a></li>

Hi guys, i wanted to find out if its possible to use just a single listView for different activities. For instance i have three activities (Pending Jobs, Incoming Jobs, Closed Jobs) which are supposed to use a ListView, as at now i have created ListViews for all three activities but i want to know if there is a way to use just one ListView for all the three activities. So let say when i click on the Pending Jobs Activity it calls the listView but pulls the data of pending jobs to the listView. Same applies to all the other two but just a single listView.

Any insight, help or direction will be very much appreciated. thank you

i already have a main domain (pcgevangelism.org) and i created a sub-domain (evangelism-school.pcgevangelism.org). i have a menu named "evangelism school" now i want to know how to link my subdomain to my main domain (evangelism school menu). so when i click that menu it should take me to (evangelism-school.pcgevangelism.org

Any help or direction will be very much appreciated.

Hello guys am new to android development. I wanted to know how create a scrollview in Potrait layout using XML in android.

below is the code i wrote in XML

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="5dip"
        android:src="@drawable/newuser" android:contentDescription="@string/todo"/>

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="15dip"
        android:text="@string/first_name" />

    <EditText
        android:id="@+id/editText1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:ems="10"
        android:inputType="textPersonName" >

        <requestFocus />
    </EditText>

    <TextView
        android:id="@+id/textView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="15dip"
        android:text="@string/last_name" />

    <EditText
        android:id="@+id/editText2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:ems="10"
        android:inputType="textPersonName" />

    <TextView
        android:id="@+id/textView3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="15dip"
        android:text="@string/user_name" />

    <EditText
        android:id="@+id/editText3"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:ems="10" android:inputType="text"/>

    <TextView
        android:id="@+id/textView4"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="15dip"
        android:text="@string/password" />

    <EditText
        android:id="@+id/editText4"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:ems="10"
        android:inputType="textPassword" />

    <TextView
        android:id="@+id/textView5"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="15dip"
        android:text="@string/district" />

    <EditText
        android:id="@+id/editText5"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:ems="10" android:inputType="text"/>

    <TextView
        android:id="@+id/textView6"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="15dip"
        android:text="@string/user_role" />

</LinearLayout>

i want to know how a scrollView can be added to this. Thank You

Hello guys i want to show a data in my combobox when i click on an item ion my jtable
i tried this but it doesn't work. i would apprecite it if any one can help thanx

 String add5 = rs.getString("Id_branch");
                branch_combo.setSelectedItem(add5);

 String add6 = rs.getString("User_Role");
                UserRole_combo.setSelectedItem(add6);

Hello guys i want to know if its possible to format a text as it is done ms-word on a jframe? i want to be able to edit the text i put on my jframe by specifying the heading, making some texts bold, adding font color to som texts and all that. Please let me know if its possible to do this. Am creating an about us form and i need to edit the text i place on the form. If it is possible i will appreciate the direction or help. Thank you.

how to store JTree data hierarchically in mysql database from netbeans. I am new to this topics so I need a program and tables you are using in database . for ex:

 Items |-shoes |-shirts |-half shirt |-sarees

when i click on add button it should add nodes to parent node(items node)such that the child node should be visible on tree and should be saved in database also

is that possible? am still new at java so will appreciate the help or direction

hello guys i am still new in java and i have been battling with this problem. i want to filter my data in my jtable.

i have got the following data in my jtable which is from my database.

| name | gender | courses |
|------|--------|---------|
| Ben  | male   | Science |
| Joe  |female  |   I.T   |
| Dan  | Male   | Science |

now i have got combo-boxes name,gender and courses

now i want to filter the table based on these assumptions

"i want all who are studying science"
so then the output becomes

| name |courses|     
|------|-------|      
| Ben  |Science|      
| Dan  |Science|  

"i want all males who are studying science"
so then the output becomes

| name | gender | courses |     
|------|--------|---------|      
| Ben  | male   | Science |      
| Dan  | Male   | Science | 

and so on..... Please any help or direction will be appreciated thanks

i want to populate my jtable with selected items in my jcombobox below is the code i wrote to perform the action but it does not.
please am still new in java so i will appreciation the help.

if(AssetCategories.getSelectedItem() == "LAND & BUILDINGS"){
            try {         
              String sql = "SELECT Description FROM items where Description_Code = 'LB' Order by id";
              pst=conn.prepareStatement(sql);
              rs=pst.executeQuery();
              dep_report.setModel(DbUtils.resultSetToTableModel(rs));
            } catch (SQLException ex) {
                Logger.getLogger(DepreciationReport.class.getName()).log(Level.SEVERE, null, ex);
            }

     } 

thanks for the help

below's code is a code i wrote to get the value of 'monthly Depreciation' when i select the row on my jTable by either mouse-clicked or key-pressed. but it only selects the first value for 'monthly depreciation' when i click on the rows or key-press.the problem i know is coming from the where statement but can't seem to get around it.

 if(evt.getKeyCode()==KeyEvent.VK_DOWN || evt.getKeyCode()==KeyEvent.VK_UP)
        {
           try{
          int row =dep_report.getSelectedRow();
          String Table_click=(dep_report.getModel().getValueAt(row, 0).toString());
          String sql ="select Date_Acquired 'Date Acquired',Serial_Number 'Serial Number',"
                + " Description 'Description',Cost_Of_Acquisition 'Cost Of Acquisition',"
                + "Monthly_Depreciation 'Monthly Depreciation',Accumulated_Depreciation 'Accumulated                      Depreciation',Net_Book_Value 'Net Book Value'"
                + ",asset_update.Branch_Area 'Branch Area',Depts_name 'Department Name' ,User 'User',"
                + "Status 'Status' from items,asset_update where items.items_No = asset_update.items_No &&'"+Table_click+"'";
          pst = conn.prepareStatement(sql);
          rs = pst.executeQuery();

          if(rs.next()){
                String add1 = rs.getString("Monthly Depreciation");
                MonthlyDep.setText(add1);

            }

        }
        catch(Exception e)
        {
        JOptionPane.showMessageDialog(null, e);    
        }  

I would really appreciate the help thank you.

i don't if my question is clear but i have a jDateChooser on my app. so when i pick a date, that date should be converted to an integer. so let say i pick 1-2-2013, this date should be converted to an interger.

thank your help and patience

exactly i want perform some maths with the integer value i get from my datepicker.

and i am hiving trouble with assigning my jdatechooser to the inputDate variable.

i want to convert the date i pick into an integer and use that integer value in my math calculations.
i hope it is clear now? thans

i want to convert the value of my date into an integer value, i am using a jDateChooser in netbeans(swings)
currently in my code below the value for inputDate is fixed or assingned but i want it to be based on the date a user picks using the jDateChooser.

 public void OnDateClick(){
        int inputDate = 20121220 ;//variable name for my  jDateChooser is "OnDateClick" which i want assign to inputDate
        DateFormat df = new SimpleDateFormat("yyyyMMdd");
        String date = df.format(Integer.valueOf(inputDate));

        String s = date.format(date);
        int output = Integer.valueOf(s);
        System.out.println(s);
    }

I will appreciate the help thank you.

double compute()
{
double monthly, acumulation;
for(int y = 1; y<5; y++)
{
monthly = (Cost * numYears) / residual;
acumulation = (monthly * y);
return acumulation;
}
}

this is function i wrote to compute monthyly depreiation and accumulation. but the error i get is missing return statemen and i dont really get where that is coming from

Honestly am writing an application and am stuck at this point.
problem is am writing an asset derpreciation application and i am calculating for Monthly Depreciation,End-of-year value ,Accumulated depreciatio.I want get the results of the values in this form in my jTable when the calculation is done.

for example when i enter the number of months, it should display the results over that number,so if it is 7 it should display as below.

           Monthly            End-of-year       Accumulated
Months   Depreciation          value            depreciation
----     ------------         -----------       ------------
1           4000                24000            4000
2           4000                20000            8000
3           4000                16000            12000
4           4000                12000            16000
5           4000                8000            20000
6           4000                4000             24000
7           4000                 0               28000

how to get this in my jtable is now my headache. I will appreciate the assistance very much thank you

I want to create a jTree which when i right click on a node, should give me the options of "rename","add Region(parent)","add City(child)".

the name of my jTree is branches

As i am new to swing,Could any one help with code. Thanks in Advance.

Regards, Sarkwa

i dnt know but it still gives me this error "#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')

BEGIN
set Months_Depreciated =
(
  YEAR
( 
NOW() * 12 + Month
(
NOW()
)
) - Y' at line 11  "
drop trigger if exists update_asset;
drop trigger if exists insert_asset;
drop trigger if exists process_asset;

delimiter |
create procedure process_asset_calc
 (
in name varchar(50),
in cost decimal(20,2),
in life int(11),
in whenacquired date,
inout Months_Depreciated int(11),
inout Accumulated_Value double(2,0),
in residual_value double(2,0),
inout Monthly_Depreciation double(2,0),

)
BEGIN
set Months_Depreciated = (YEAR(NOW() * 12 + Month (NOW())) - YEAR(whenacquired)*12;
set Monthly_Depreciation = (cost/life)*residual_value;
set Accumulated_Value = Months_Depreciated * Monthly_Depreciation;
END|
CREATE TRIGGER `update_asset`
before update ON `asset`
for each row
BEGIN
call process_asset_calc(new.name,new.cost,new.life,new.residual_value,new.whenacquired,new.Accumulated_Value,new.Monthly_Depreciation, new.Months_Depreciated);
END|
CREATE TRIGGER `insert_asset`
before insert ON `asset`
for each row
BEGIN
  call process_asset_calc(new.name,new.cost,new.life,new.residual_value,new.whenacquired,new.Accumulated_Value,new.Monthly_Depreciation, new.Months_Depreciated);
END|

delimiter ;

when i run this code it gives me this error "#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')
BEGIN
set Months_Depreciated = (YEAR(NOW() * 12 + Month (NOW())) - YEAR(whenac' at line 12 "

and i can't seem to get what it means. Please any help clearing this error will be appreciated. thanks

thanks i solved it

i want to get the value for Accumulation but it returns no value. Any help with resolving it will be appreiated

    private double getAccumulation(){
       double Accumulation = 0;
       double Monthly_Depreciation;
       int Estimated_Useful_Life = 5;
       double Cost_Of_Acquisition = 2000;
       double Estimated_Residual_Value = 500;

       try{
            Monthly_Depreciation = (Cost_Of_Acquisition - Estimated_Residual_Value)/Estimated_Useful_Life;

            Accumulation += Monthly_Depreciation;
            Accumulation++;
            System.out.print(Accumulation);

       }catch(Exception e){
        JOptionPane.showMessageDialog(null, e);   
       }

       return Accumulation;
   }

i want to write a function which calculates the Monthly depreciation and accumulation of an asset but i am having difficulties writing it to calculate and insert it into my datebase.I will appreciate the help

private double getAccumulation(){
       double Accumulation = 0;
       double Monthly_Depreciation;
       int Estimated_Useful_Life = Integer.parseInt(eul.getText());
       double Cost_Of_Acquisition = Integer.parseInt(txt_coa.getText());
       double Estimated_Residual_Value = Integer.parseInt(txt_erv.getText());

       try{
            Monthly_Depreciation = (Cost_Of_Acquisition - Estimated_Residual_Value)/Estimated_Useful_Life;
            Accumulation = Monthly_Depreciation;
            Accumulation++;

       }catch(Exception e){
        JOptionPane.showMessageDialog(null, e);   
       }

       return Accumulation;
   }

that is my interface so i want to the user to enter the "cost of acquisition","residual value", and the "cost of acquistion" but currently it the values are declared in the code

@stultuske my problem is how to implment it in the code

I am writing an asset monthly depreciation system and i have written a code which works but i want to set the values such that the user enters the value manually into the system. Currently the values have been declared with a variable. this is my code

 // declare an integer (array) array with 6 rows (6 assets)  
    // & 5 columns (5 attributes for each asset)
        int assetInfo[][] = new int [6][5];

    // populate the first row with asset#100 information
        assetInfo[0][0] = 100;        //asset number(how do i set this to a jtextfield?)
        assetInfo[0][1] = 3000;        //acquisitionCost(how do i set this to a jtextfield?)
        assetInfo[0][2] = 300;        //approximateSalvageValue(how do i set this to a jtextfield?) 
        assetInfo[0][3] = 6;        //numberOfYearsUsefulLife(how do i set this to a jtextfield?)
        assetInfo[0][4] = 1;        //deprecationMethod(how do i set this to a jComboBox?)    

        // populate the second row with asset#101 information
        assetInfo[1][0] = 101;        //asset number(how do i set this to a jtextfield?)
        assetInfo[1][1] = 25000;    //acquisitionCost(how do i set this to a jtextfield?)
        assetInfo[1][2] = 1000;        //approximateSalvageValue (how do i set this to a jtextfield?)
        assetInfo[1][3] = 3;        //numberOfYearsUsefulLife(how do i set this to a jtextfield?)
        assetInfo[1][4] = 2;        //deprecationMethod(how do i set this to a jComboBox?)    

        // populate the third row with asset#102 information
        assetInfo[2][0] = 102;        //asset number(how do i set this to a jtextfield?)
        assetInfo[2][1] = 9000;        //acquisitionCost(how do i set this to a jtextfield?)
        assetInfo[2][2] = 500;        //approximateSalvageValue(how do i set this to a jtextfield?) 
        assetInfo[2][3] = 5;        //numberOfYearsUsefulLife(how do i ...

@mKorbel i hope u get my question?

so in this case LB/
i wrote this to do that but it is giving me redundancy
instead of showing only 'LB/',it shows more than one 'LB/'
so now how can i make it show only the one selected item
and when i select another item in 'desc code' it should change in the 'item code' too

i hope this makes my question clearer