Search Results

Search found 6339 results on 254 pages for 'josh 24 2'.

Page 48/254 | < Previous Page | 44 45 46 47 48 49 50 51 52 53 54 55  | Next Page >

  • Running a SQL query in rails

    - by Bharat
    Hello I have a rails application where I have to subtract 2 time stamps and display the result on the webpage I have used the following sql statement and I am getting the results. select (julianday(resolutions.created_at)-julianday(tickets.created_at))*24 from tickets,resolutions the value of tickets.created_at is 2010-04-05 18:59:02 which is a time stamp and value of resolutions.created_at is 2010-04-08 08:10:33 Now where do I put this sql so that I can be seen in my webpage. I tired it in the views page with the following but nothing showed up: <% @sql = "select (julianday(resolutions.created_at)-julianday(tickets.created_at))*24 from tickets,resolutions" %> <% @t=(ActiveRecord::Base.connection.execute(@sql)) %> So how do I display it on my webpage? when I perform the above I get the output printed on the webpage as 061.1919444389641(julianday(resolutions.created_at)-julianday(tickets.created_at))*2461.1919444389641 only 61.1919444389641 is supposed to be printed but the query statement is also getting printed.

    Read the article

  • Logictech USB HID controller message

    - by rross
    I have a Logitech game controller(http://www.amazon.com/Logitech-Dual-Action-Game-Pad/dp/B0000ALFCI). I'm using c# and Microsoft's HID driver to track what buttons are being pressed. Each button press sends a Byte Array that has 8 values. The problems is that I don't know what those 8 value represent. Here is an example: 0, 128, 126, 127, 130, 24, 24, 0, 4, 252 0, 128, 126, 127, 130, 40, 40, 0, 4, 252 0, 128, 126, 127, 127, 72, 72, 0, 4, 252 0, 128, 126, 127, 127, 136, 136, 0, 4, 252 Those are the values of the Byte Array for button press 1, 2, 3, 4 respectively. I see where the values are changing, but I'm unsure what they represent. I'm unable to find any specs on Microsoft HID driver. Can someone point me in the right direction?

    Read the article

  • iPhone application launch time guidelines

    - by Alexander Gladysh
    Please point me to the iPhone application launch time guidelines. I see that there is a hard limit of ~24 seconds. OS kills application if it did not started in that time with the message: com.bundle.id failed to launch in time There is also a QA article on this. (24 seconds is the time until OS on my phone kills the app.) But I think that there should be a shorter soft limit somewhere in the docs. However, my google-fu failed me and I was not able to find it. Any help?

    Read the article

  • Presentmodalviewcontroller method problem with retain count

    - by Infinity
    Hello guys! I am trying to present a modal view controller. I have read the documentation, but something is strange. Here's my code: NSLog(@"rc: %d", [modalViewController retainCount]); UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:modalViewController]; [self presentModalViewController:navigationController animated:YES]; [navigationController release]; NSLog(@"rc: %d", [modalViewController retainCount]); And on the console, appears: rc: 2 rc: 24 And I think 24 is very strange... What do you thin? Why is this happening?

    Read the article

  • How to create Query syntax for multiple DataTable for implementing IN operator of Sql Server

    - by Shantanu Gupta
    I have fetched 3-4 tables by executing my stored procedure. Now they resides on my dataset. I have to maintain this dataset for multiple forms and I am not doing any DML operation on this dataset. Now this dataset contains 4 tables out of which i have to fetch some records to display data. Data stored in tables are in form of one to many relationship. i.e. In case of transactions. N records per record. Then these N records are further mapped to M records of 3rd table. Table 1 MAP_ID GUEST_ID DEPARTMENT_ID PARENT_ID PREFERENCE_ID -------------------- -------------------- -------------------- -------------------- -------------------- 19 61 1 1 5 14 61 1 5 15 15 61 2 4 10 18 61 2 13 23 17 61 2 20 26 16 61 40 40 41 20 62 1 5 14 21 62 1 5 15 22 62 1 6 16 24 62 2 3 4 23 62 2 4 9 27 62 2 13 23 25 62 2 20 24 26 62 2 20 25 28 63 1 1 5 29 63 1 1 8 34 63 1 5 15 30 63 2 4 10 33 63 2 4 11 31 63 2 13 23 32 63 40 40 41 35 65 1 NULL 1 36 65 1 NULL 1 38 68 2 13 22 37 68 2 20 25 39 68 2 23 27 40 92 1 NULL 1 Table 2 Department_ID Department_Name Parent_Id Parent_Name -------------------- ----------------------- --------------- ---------------------------------------------------------------------------------- 1 Food 1, 5, 6 Food, North Indian, South Indian 2 Lodging 3, 4, 13, 20, 23 Room, Floor, Non Air Conditioned, With Balcony, Without Balcony 40 New 40 SubNew TABLE 3 Parent_Id Parent_Name Preference_ID Preference_Name -------------------- ----------------------------------------------- ----------------------- ------------------- NULL NULL NULL NULL 1 Food 5, 8 North Indian, Italian 3 Room 4 Floor 4 Floor 9, 10, 11 First, Second, Third 5 North Indian 14, 15 X, Y 6 South Indian 16 Dosa 13 Non Air Conditioned 22, 23 With Balcony, Without Balcony 20 With Balcony 24, 25, 26 Mountain View, Ocean View, Garden View 23 Without Balcony 27 Mountain View 40 New 41 SubNew I have these 3 tables that are related in some fashion like this. Table 1 will be the master for these 2 tables i.e. table 2 and table 3. I need to query on them as SELECT Department_Id, Department_Name, Parent_Name FROM Table2 WHERE Department_Id in ( SELECT Department_Id FROM Table1 WHERE guest_id=65 ) SELECT Parent_Id, Parent_Name, Preference_Name FROM Table3 WHERE PARENT_ID in ( SELECT parent_id FROM Table1 WHERE guest_id=65 ) Now I need to use these queries on DataTables. So I am using Query Syntax for this and reached up to this point. var dept_list= from dept in DtMapGuestDepartment.AsEnumerable() where dept.Field<long>("PK_GUEST_ID")==long.Parse(63) select dept; This should give me the list of all departments that has guest id =63 Now I want to select all departments_name and parent_name from Table 2 where guest_id=63 i.e. departments that i fetched above. This same case will be followed for Table3. Please suggest how to do this. Thanks for keeping up patience for reading my question.

    Read the article

  • using bash: write bit representation of integer to file

    - by theseion
    Hullo First, I want to use bash for this and the script should run on as many systems as possible (I don't know if the target system will have python or whatever installed). Here's the problem: I have a file with binary data and I need to replace a few bytes in a certain position. I've come up with the following to direct bash to the offset and show me that it found the place I want: dd bs=1 if=file iseek=24 conv=block cbs=2 | hexdump Now, to use "file" as the output: echo anInteger | dd bs=1 of=hextest.txt oseek=24 conv=block cbs=2 This seems to work just fine, I can review the changes made in a hex editor. Problem is, "anInteger" will be written as the ASCII representation of that integer (which makes sense) but I need to write the binary representation. How do I tell the command to convert the input to binary (possibly from a hex)?

    Read the article

  • Mysql: i need to get the offset of a item in a query.

    - by user305270
    Mysql: i need to get the offset of a item in a query. I have a image gallery: this show 6 image per stack, so when i request image 22 it shows images from 18 to 24. It should first get the offset of the image 22, then get the images from 18 to 24. Another example: i request the image number 62(and offset 62), it will select images with offset from 60 to 66. Is possible with a single query? Thanks ;)

    Read the article

  • Array Searching code challenge

    - by RCIX
    Here's my (code golf) challenge: Take two arrays of bytes and determine if the second array is a substring of the first. If it is, output the index at which the contents of the second array appear in the first. If you do not find the second array in the first, then output -1. Example Input: { 63, 101, 245, 215, 0 } { 245, 215 } Expected Output: 2 Example Input 2: { 24, 55, 74, 3, 1 } { 24, 56, 74 } Expected Output 2: -1 Edit: Someone has pointed out that the bool is redundant, so all your function has to do is return an int representing the index of the value or -1 if not found.

    Read the article

  • NSDateFormatter, am I doing something wrong or is this a bug?

    - by rustyshelf
    I'm trying to print out the date in a certain format: NSDate *today = [[NSDate alloc] init]; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"yyyyMMddHHmmss"]; NSString *dateStr = [dateFormatter stringFromDate:today]; If the iPhone is set to 24 hour time, this works fine, if on the other hand the user has set it to 24 hour time, then back to AM/PM (it works fine until you toggle this setting) then it appends the AM/PM on the end even though I didn't ask for it: 20080927030337 PM Am I doing something wrong or is this a bug with firmware 2.1? Edit 1: Made description clearer Edit 2 workaround: It turns out this is a bug, to fix it I set the AM and PM characters to "": [dateFormatter setAMSymbol:@""]; [dateFormatter setPMSymbol:@""];

    Read the article

  • Modifying NSDate to represent 1 month from today

    - by bmalicoat
    I'm adding repeating events to a Cocoa app I'm working on. I have repeat every day and week fine because I can define these mathematically (3600*24*7 = 1 week). I use the following code to modify the date: [NSDate dateWithTimeIntervalSinceNow:(3600*24*7*(weeks))] I know how many months have passed since the event was repeated but I can't figure out how to make an NSDate object that represents 1 month/3 months/6 months/9 months into the future. Ideally I want the user to say repeat monthly starting Oct. 14 and it will repeat the 14th of every month.

    Read the article

  • Pushwoosh SDK Notification Issue

    - by dvb
    I have integrated the Pushwoosh SDK in my Android Application and it is working fine. I have done the Cross Platform Setting to run the Android Application on my Blackberry Z10 device, the application is running finely but I am not able to receive the Notification on my Blackberry Z10 device as Android. I am getting this error: 06-06 14:34:21.314: I/QNXNavigatorClient(8708260): Already active: com.packagename.pushdemo 06-06 14:34:21.662: I/QNXNavigatorClient(8708260): PackagesOpenedRunnable: [com.packagename.pushdemo] 06-06 14:34:21.662: I/QNXNavigatorClient(8708260): Shell com.packagename.pushdemo cannot join group, group was already joined 06-06 14:34:21.668: I/ActivityManager(8708260): Displayed com.packagename.pushdemo/.MainActivity: +347ms 06-06 14:34:24.118: E/QNXShrimpClient(8708260): com.google.android.c2dm.intent.REGISTER error(10108) = "" 06-06 14:34:24.124: W/ContextImpl(8708260): Calling a method in the system process without a qualified user: android.app.ContextImpl.sendOrderedBroadcast:1061 com.android.server.QNXShrimpClient.onRegisterComplete:162 com.qnx.service.pps.shrimp.ShrimpController.onMessageReceived:128 com.qnx.service.pps.PPSObject.processMessage:292 com.qnx.service.pps.PPSObject.access$500:11 I am not able to get the Push Notification on my Blackberry Z10 device.

    Read the article

  • Can this MySQL subquery be optimised?

    - by Dan
    I have two tables, news and news_views. Every time an article is viewed, the news id, IP address and date is recorded in news_views. I'm using a query with a subquery to fetch the most viewed titles from news, by getting the total count of views in the last 24 hours for each one. It works fine except that it takes between 5-10 seconds to run, presumably because there's hundreds of thousands of rows in news_views and it has to go through the entire table before it can finish. The query is as follows, is there any way at all it can be improved? SELECT n.title , nv.views FROM news n LEFT JOIN ( SELECT news_id , count( DISTINCT ip ) AS views FROM news_views WHERE datetime >= SUBDATE(now(), INTERVAL 24 HOUR) GROUP BY news_id ) AS nv ON nv.news_id = n.id ORDER BY views DESC LIMIT 15

    Read the article

  • Calculating the pixel size of a string with Python

    - by Aristide
    I have a Python script which needs to calculate the exact size of arbitrary strings displayed in arbitrary fonts in order to generate simple diagrams. I can easily do it with Tkinter. The problem is the results seem to depend on the version of Python and/or the system. import Tkinter as tk import tkFont root = tk.Tk() times12 = tkFont.Font(family="times",size=12) print times12.metrics("linespace"), print times12.measure("Hello world") times24 = tkFont.Font(family="times",size=24) print times24.metrics("linespace"), print times24.measure("Hello world") Python 2.5 on Mac OS X gives the actual pixel measurements: 12 57 24 116 Python 2.6.1 on Mac OS X gives: 14 58 27 115 Python 2.6.3 on Windows XP gives: 19 71 36 154 Such a need being quite common, I suspect I did something wrong. Any idea?

    Read the article

  • Motherboard memory question

    - by JERiv
    I am currently drawing up specs on a new workstation for my office. I am considering the Asus P6X58D for a motherboard. This board's specs list it as supporting 24 gigs of memory. Suppose I were to use six four gig memory cards and then two video cards with 1 gig of memory apiece. Is the maximum supported memory similar to how 32 bit operating systems only have enough address space for 4 gigs of memory? Simply: Will the board post? If so, will the system be able to address all the memory, both the 24 gigs on the ddr3 bus and the 3 gigs on the graphics card?

    Read the article

  • Error while exiting cherrypy server

    - by Vijayendra Bapte
    Guys, I am getting following error while exiting cherrypy server. What is this error about? 2009-11-04 09:32:35,015 WARNING Error in atexit._run_exitfuncs: 2009-11-04 09:32:35,015 WARNING 2009-11-04 09:32:35,015 WARNING Traceback (most recent call last): 2009-11-04 09:32:35,015 WARNING File "atexit.pyc", line 24, in _run_exitfuncs 2009-11-04 09:32:35,015 WARNING File "logging\__init__.pyc", line 1486, in shutdown 2009-11-04 09:32:35,015 WARNING File "logging\__init__.pyc", line 746, in flush 2009-11-04 09:32:35,015 WARNING IOError: [Errno 9] Bad file descriptor 2009-11-04 09:32:35,015 WARNING Error in sys.exitfunc: 2009-11-04 09:32:35,015 WARNING Traceback (most recent call last): 2009-11-04 09:32:35,015 WARNING File "atexit.pyc", line 24, in _run_exitfuncs 2009-11-04 09:32:35,015 WARNING File "logging\__init__.pyc", line 1486, in shutdown 2009-11-04 09:32:35,015 WARNING File "logging\__init__.pyc", line 746, in flush 2009-11-04 09:32:35,015 WARNING IOError 2009-11-04 09:32:35,015 WARNING : 2009-11-04 09:32:35,015 WARNING [Errno 9] Bad file descriptor 2009-11-04 09:32:35,015 WARNING

    Read the article

  • Using gmail as SMTP server in Java web app is slow

    - by Annie
    Hi, I was wondering if anyone might be able to explain to me why it's taking nearly 30 seconds each time my Java web app sends an email using Gmail's SMTP server? See the following timestamps: 13/04/2010-22:24:27:281 DEBUG test.service.impl.SynchronousEmailService - Before sending mail. 13/04/2010-22:24:52:625 DEBUG test.service.impl.SynchronousEmailService - After sending mail. I'm using spring's JavaMailSender class with the following settings: email.host=smtp.gmail.com [email protected] email.password=mypassword email.port=465 mail.smtp.auth.required=true Note that the mail is getting sent and I'm receiving it fine, there's just this delay which is resulting in a slow experience for the application user. If you know how I can diagnose the problem myself that would be good too :)

    Read the article

  • Please help me in creating a update query

    - by Rajesh Rolen- DotNet Developer
    I have got a table which contains 5 column and query requirements: update row no 8 (or id=8) set its column 2, column 3's value from id 9th column 2, column 3 value. means all value of column 2, 3 should be shifted to column 2, 3 of upper row (start from row no 8) and value of last row's 2, 3 will be null For example, with just 3 rows, the first row is untouched, the second to N-1th rows are shifted once, and the Nth row has nulls. id math science sst hindi english 1 11 12 13 14 15 2 21 22 23 24 25 3 31 32 33 34 35 The result of query of id=2 should be: id math science sst hindi english 1 11 12 13 14 15 2 31 32 23 24 25 //value of 3rd row (col 2,3) shifted to row 2 3 null null 33 34 35 This process should run for all rows whose id 2 Please help me to create this update query I am using MS sqlserver 2005

    Read the article

  • Decode base64 data as array in Python

    - by skerit
    I'm using this handy Javascript function to decode a base64 string and get an array in return. This is the string: base64_decode_array('6gAAAOsAAADsAAAACAEAAAkBAAAKAQAAJgEAACcBAAAoAQAA') This is what's returned: 234,0,0,0,235,0,0,0,236,0,0,0,8,1,0,0,9,1,0,0,10,1,0,0,38,1,0,0,39,1,0,0,40,1,0,0 The problem is I don't really understand the javascript function: var base64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(""); var base64inv = {}; for (var i = 0; i < base64chars.length; i++) { base64inv[base64chars[i]] = i; } function base64_decode_array (s) { // remove/ignore any characters not in the base64 characters list // or the pad character -- particularly newlines s = s.replace(new RegExp('[^'+base64chars.join("")+'=]', 'g'), ""); // replace any incoming padding with a zero pad (the 'A' character is zero) var p = (s.charAt(s.length-1) == '=' ? (s.charAt(s.length-2) == '=' ? 'AA' : 'A') : ""); var r = []; s = s.substr(0, s.length - p.length) + p; // increment over the length of this encrypted string, four characters at a time for (var c = 0; c < s.length; c += 4) { // each of these four characters represents a 6-bit index in the base64 characters list // which, when concatenated, will give the 24-bit number for the original 3 characters var n = (base64inv[s.charAt(c)] << 18) + (base64inv[s.charAt(c+1)] << 12) + (base64inv[s.charAt(c+2)] << 6) + base64inv[s.charAt(c+3)]; // split the 24-bit number into the original three 8-bit (ASCII) characters r.push((n >>> 16) & 255); r.push((n >>> 8) & 255); r.push(n & 255); } // remove any zero pad that was added to make this a multiple of 24 bits return r; } What's the function of those "<<<" and "" characters. Or is there a function like this for Python?

    Read the article

  • Raw SQL sent to SQL Server from .NET on stored procedure call

    - by Jeff Meatball Yang
    Is there a way to get the raw text that is sent to SQL Server, as seen in SQL Profiler, from the ADO.NET call? using(SqlConnection conn = new SqlConnection(connString)) { SqlCommand cmd = conn.CreateCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "GetSomeData"; cmd.Parameters.Add("@id").Value = someId; cmd.Parameters.Add("@someOtherParam").Value = "hello"; conn.Open(); SqlDataReader dr = cmd.ExecuteReader(); // this sends up the call: exec GetSomeData @id=24, @someOtherParam='hello' // how can I capture that and write it to debug? Debug.Write("exec GetSomeData @id=24, @someOtherParam='hello'"); }

    Read the article

  • MySQL: filling empty fields with zeroes when using GROUP BY

    - by SaltLake
    I've got MySQL table CREATE TABLE cms_webstat ( ID int NOT NULL auto_increment PRIMARY KEY, TIMESTAMP_X timestamp DEFAULT CURRENT_TIMESTAMP, # ... some other fields ... ) which contains statistics about site visitors. For getting visits per hour I use SELECT hour(TIMESTAMP_X) as HOUR , count(*) AS HOUR_STAT FROM cms_webstat GROUP BY HOUR ORDER BY HOUR DESC which gives me | HOUR | HOUR_STAT | | 24 | 15 | | 23 | 12 | | 22 | 9 | | 20 | 3 | | 18 | 2 | | 15 | 1 | | 12 | 3 | | 9 | 1 | | 3 | 5 | | 2 | 7 | | 1 | 9 | | 0 | 12 | And I'd like to get following: | HOUR | HOUR_STAT | | 24 | 15 | | 23 | 12 | | 22 | 9 | | 21 | 0 | | 20 | 3 | | 19 | 0 | | 18 | 2 | | 17 | 0 | | 16 | 0 | | 15 | 1 | | 14 | 0 | | 13 | 0 | | 12 | 3 | | 11 | 0 | | 10 | 0 | | 9 | 1 | | 8 | 0 | | 7 | 0 | | 6 | 0 | | 5 | 0 | | 4 | 0 | | 3 | 5 | | 2 | 7 | | 1 | 9 | | 0 | 12 | How should I modify the query to get such result? Thanks.

    Read the article

  • Images appear in simulator but not when uploading to ipod touch (3.0)

    - by user139190
    I created a simple test app with an image (as well as a button with an image) and it runs fine in the simulator. But when uploading to the iPod, none of the images appear. The button appears but with no image. A few things worth mentioning: - Today's massive achievement was making it beyond the code signing errors and so I have not had any applications uploaded to the device until now. IOW, it's not a sudden change. - The png image is about 100 x 200. - I also set an icon image (png 24 x 24) that does not appear either. Thanks in advance for any advice.

    Read the article

  • Proper structure for many test cases in Python with unittest

    - by mellort
    I am looking into the unittest package, and I'm not sure of the proper way to structure my test cases when writing a lot of them for the same method. Say I have a fact function which calculates the factorial of a number; would this testing file be OK? import unittest class functions_tester(unittest.TestCase): def test_fact_1(self): self.assertEqual(1, fact(1)) def test_fact_2(self): self.assertEqual(2, fact(2)) def test_fact_3(self): self.assertEqual(6, fact(3)) def test_fact_4(self): self.assertEqual(24, fact(4)) def test_fact_5(self): self.assertFalse(1==fact(5)) def test_fact_6(self): self.assertRaises(RuntimeError, fact, -1) #fact(-1) if __name__ == "__main__": unittest.main() It seems sloppy to have so many test methods for one method. I'd like to just have one testing method and put a ton of basic test cases (ie 4! ==24, 3!==6, 5!==120, and so on), but unittest doesn't let you do that. What is the best way to structure a testing file in this scenario? Thanks in advance for the help.

    Read the article

  • Image not loading onto JPanel?

    - by None None
    I have been trying to figure out how to add an image to a JPanel as a background, but still have complete control over the placing of JButtons, JLabels, and etc. This is one method I found, but it is crashing and not loading the image or buttons. Here is the code: import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JButton; import java.awt.BorderLayout; import java.awt.FlowLayout; import java.awt.GridLayout; public class PanelDemo extends JFrame { private static final long serialVersionUID = 1L; private JButton btn1 = new JButton("EASY"); private JButton btn2 = new JButton("MEDIUM"); private JButton btn3 = new JButton("HARD"); private JButton btn4 = new JButton("High Score"); public PanelDemo() { super("Image Panel Demo"); JPanel panel = new ImagePanel( new FlowLayout(FlowLayout.CENTER, 50, 180)); JPanel panelbtn = new JPanel(new GridLayout(4, 1)); btn1.setBackground(new java.awt.Color(0, 0, 0)); btn1.setFont(new java.awt.Font("Showcard Gothic", 1, 24)); btn1.setForeground(new java.awt.Color(0, 255, 102)); btn2.setBackground(new java.awt.Color(0, 0, 0)); btn2.setFont(new java.awt.Font("Showcard Gothic", 1, 24)); btn2.setForeground(new java.awt.Color(0, 255, 102)); btn3.setBackground(new java.awt.Color(0, 0, 0)); btn3.setFont(new java.awt.Font("Showcard Gothic", 1, 24)); btn3.setForeground(new java.awt.Color(0, 255, 102)); btn4.setBackground(new java.awt.Color(0, 0, 0)); btn4.setFont(new java.awt.Font("Showcard Gothic", 1, 24)); btn4.setForeground(new java.awt.Color(0, 255, 102)); panel.add(panelbtn); panelbtn.add(btn1); panelbtn.add(btn2); panelbtn.add(btn3); panelbtn.add(btn4); add(panel, BorderLayout.CENTER); setSize(640, 480); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } public static void main(String... args) { new PanelDemo().setVisible(true); } } ImagePanel.java import java.awt.Graphics; import java.awt.Image; import java.awt.LayoutManager; import javax.swing.ImageIcon; import javax.swing.JPanel; public class ImagePanel extends JPanel { private static final long serialVersionUID = 1L; String imageFile = "/rsc/img/background.jpg"; public ImagePanel() { super(); } public ImagePanel(String image) { super(); this.imageFile = image; } public ImagePanel(LayoutManager layout) { super(layout); } public void paintComponent(Graphics g) { ImageIcon imageicon = new ImageIcon(getClass().getResource(imageFile)); Image image = imageicon.getImage(); super.paintComponent(g); if (image != null) g.drawImage(image, 0, 0, getWidth(), getHeight(), this); } } Error: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at javax.swing.ImageIcon.<init>(Unknown Source) at ImagePanel.paintComponent(ImagePanel.java:27) at javax.swing.JComponent.paint(Unknown Source) at javax.swing.JComponent.paintChildren(Unknown Source) at javax.swing.JComponent.paint(Unknown Source) at javax.swing.JComponent.paintChildren(Unknown Source) at javax.swing.JComponent.paint(Unknown Source) at javax.swing.JLayeredPane.paint(Unknown Source) at javax.swing.JComponent.paintChildren(Unknown Source) at javax.swing.JComponent.paintToOffscreen(Unknown Source) at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source) at javax.swing.RepaintManager$PaintManager.paint(Unknown Source) at javax.swing.RepaintManager.paint(Unknown Source) at javax.swing.JComponent.paint(Unknown Source) at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source) at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source) at sun.awt.SunGraphicsCallback.runComponents(Unknown Source) at java.awt.Container.paint(Unknown Source) at java.awt.Window.paint(Unknown Source) at javax.swing.RepaintManager$3.run(Unknown Source) at javax.swing.RepaintManager$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source) at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source) at javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source) at javax.swing.RepaintManager.access$1000(Unknown Source) at javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$200(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) Also, if anyone knows of a better way to put a background image on a JPanel, pease do tell. Thank you in advance.

    Read the article

< Previous Page | 44 45 46 47 48 49 50 51 52 53 54 55  | Next Page >