User Profile

Collapse

Profile Sidebar

Collapse
Norgy
Norgy
Last Activity: May 15 '15, 08:39 AM
Joined: May 17 '13
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Norgy
    started a topic image dragging

    image dragging

    i am trying to write a code which drags an image, but it is not working and i don't know the reason
    here is the code:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
    	<head>
    		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"
    ...
    See more | Go to post

  • Norgy
    started a topic array of objects
    in Java

    array of objects

    i am trying to add a new object to a normal member inner class named MyLine
    here is the inner class:
    Code:
    class MyLine{
    
    		public void add(int xx1, int yy1, int xx2, int yy2){
    			x1=xx1;
    			x2=xx2;
    			y1=yy1;
    			y2=yy2;
    		}
    		public int getX1(){return x1;}
    		public int getX2(){return x2;}
    		public int getY1(){return y1;}
    		public int getY2(){return y2;}
    ...
    See more | Go to post

  • Norgy
    replied to drawing array of lines
    in Java
    i have modified the code but still not working and i want to know the solution!
    Code:
    import java.applet.Applet;
    import java.awt.Graphics;
    import java.awt.event.MouseAdapter;
    import java.awt.Color;
    import java.awt.event.MouseMotionListener; 
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    
    
    public class MultipleLineClass extends Applet{
    	int x1,y1,x2,y2;;
    	MyLine[]
    ...
    See more | Go to post

    Leave a comment:


  • Norgy
    started a topic drawing array of lines
    in Java

    drawing array of lines

    i am trying to draw an array of lines where the user will be able to draw multiple lines
    here is the code but it is not working well and i don't know why

    Code:
    import java.applet.Applet;
    import java.awt.Graphics;
    import java.awt.event.MouseAdapter;
    import java.awt.Color;
    import java.awt.event.MouseMotionListener; 
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    ...
    See more | Go to post

  • Norgy
    replied to writing to file
    in C
    i have tried to use fread and fwrite but nothing changed

    Code:
    #include <stdio.h>
    #include<string.h>
    /* run this program using the console pauser or add your own getch, system("pause") or input loop */
    struct Contacts
    {
    	char name[20];
    	int phone;
    	char address[20];
    	
    };
    //functions prototypes
     int countLines();
     //void write (int c);
      void
    ...
    See more | Go to post

    Leave a comment:


  • Norgy
    started a topic writing to file
    in C

    writing to file

    i am trying to sort an array of structures and put it in a file
    here is the code
    Code:
    #include <stdio.h>
    #include<string.h>
    
    struct Contacts
    {
    	char name[20];
    	int phone;
    	char address[20];
    	
    };
    int countLines(FILE * fp);
    
    void readfromfile(int c);
         
      
      
    int main(int argc, char** argv) {
    	FILE *f=fopen("D:\\test.txt","r");
    ...
    See more | Go to post

  • Norgy
    started a topic how to use fscanf
    in C

    how to use fscanf

    I am trying to read the name, phone number and address from a file
    here is the code but it doesn't work and i don't know where is the problem
    Code:
    #include <stdio.h>
    #include <stdlib.h>
    struct PhoneBook{
    		char name[50];
    		int phoneNumber;
    		char address[50];
    } ;
    int read(struct PhoneBook user[], int n, FILE* fp);
    
    
    void main()
    {
    	//int i, j;
    ...
    See more | Go to post

  • separating each word in a string even if they are not separated by spaces

    if we have this string : number of doses(1000mg/m2)
    and i want to separate each word in a string
    when i do this
    Code:
            String doses = "number of doses(1000mg/m2)";
            String[] split = doses.split(" ");
            for(int i=0 ; i<split.length ; i++){
                System.out.println(split[i]);
            }
    the output is :
    number
    of
    doses(1000mg/m2)...
    See more | Go to post

  • i found a function called "contains" that do what i need
    Code:
    if(x[i].contains("_"))
    thanks :)
    See more | Go to post

    Leave a comment:


  • Norgy
    started a topic comparing part of a string regardless the other part
    in Java

    comparing part of a string regardless the other part

    how can i compare part of a string with another string regardless the rest of the string?
    for example: if i want to find whether a string has an underscore or not
    Code:
    if(x[i].equals("anything_anything"))
    i want this if condition to return true
    how can i do that ?
    See more | Go to post

  • i used the timestamp field and it works correctly
    thanks a lot :)
    See more | Go to post

    Leave a comment:


  • i tried the auto increment field, but it makes me drop the primary key of the table and make that field the pk
    i want the table as it is without changing anything in it
    See more | Go to post

    Leave a comment:


  • Norgy
    started a topic reterieving the most recently added data from MySQL

    reterieving the most recently added data from MySQL

    i want to get the most recently added data from MySQL
    for example, if we have a table named test with column : id
    the data is inserted as follows: 2, 4, 1, 3
    when i type this query :
    Code:
    SELECT * FROM test ORDER BY id DESC LIMIT 1
    , it returns 4
    but i want a query that returns 3 (the last inserted data)
    can i do this?
    See more | Go to post

  • Norgy
    started a topic saving the text written in the JTextField
    in Java

    saving the text written in the JTextField

    in NetBeans, i have made the design shown in the picture
    when i press the "next" button , it is supposed to direct me to another window and close this one
    and when i press the "back" button in the second window, it redirects me to the window shown in the picture
    but without the text written in the JTextField
    how to keep the text even after closing the window??...
    See more | Go to post

  • Norgy
    replied to closing JFrame with button click
    in Java
    i have tried : this.dispose; and it worked
    See more | Go to post

    Leave a comment:


  • Norgy
    replied to no connection in MySQL
    where can i find the config file ? ^_^
    i have typed : mysql> SHOW VARIABLES LIKE 'skip_networkin g';
    in the MySQL command line client to change the skip_networking variable from ON to OFF, but when i type my passwprd, the command window disappears
    See more | Go to post

    Leave a comment:


  • Norgy
    started a topic closing JFrame with button click
    in Java

    closing JFrame with button click

    Code:
        private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
            // TODO add your handling code here:
    
            next2 nx = new next2();
            next me = new next();
            me.setVisible(false);
            nx.setVisible(true);
            
        }
    i am trying to close the "next" frame with the line me.setVisible(f alse); and display...
    See more | Go to post

  • Norgy
    started a topic multiple frames in java using drag and drop
    in Java

    multiple frames in java using drag and drop

    can i make multiple frames in java using drag and drop?
    i want to make a button that directs me to another frame
    can i do this without writing code?
    just drag and drop
    See more | Go to post

  • Norgy
    started a topic no connection in MySQL

    no connection in MySQL

    i have installed another version of MySQL database, but when i try to make a new connection, this (in the attached picture) appears to me!
    what shall i do?...
    See more | Go to post

  • Norgy
    replied to adding items in jcombobox
    in Java
    i tried to write -> pnos.addItem(pn o);
    and removed the line of System.out.prin tln
    but the problem hasn't resolved yet
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...