Search Results

Search found 37239 results on 1490 pages for 'javax swing text'.

Page 26/1490 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • Strip the last line from a text file

    - by fraXis
    Hello, I need to strip the last line from a text file. I know how to open and save text files in C#, but how would I strip the last line of the text file? The text file will always be different sizes (some have 80 lines, some have 20). Can someone please show me how to do this? Thanks.

    Read the article

  • How to draw mixed-formatted text with .Net 2.0

    - by Baldewin
    Hi, is there a way to draw mixed-formatted text in .Net 2.0? I'm looking for something similar to System.Drawing.Graphics.DrawString() My problem with this method is that it allows only one format style for the whole text. But I need to draw text that has different format styles (e.g. a part of the text shall be underlined, another part bold and so on). Thanks a lot! Oliver

    Read the article

  • Qt - serialize/deserialaize text plus picture

    - by Narek
    I want to use a field (kind of QTextEdit), which is capabale of storing picture and text (like MS Word is doing) and it serializes and deserialaizes picture+text data. Is there any Qt Widget that allows us to manipulate with picture and text simultaniously and it has set/get functions which operate with serializable type? In othger words, I want to know if there exsists any Qt widget that can store picture+text and has "get" types of function that returns the content of that widgets editable area, which is a Type that could be serialized with QDataStream.

    Read the article

  • jQuery: Returns only part of a text

    - by Warrantica
    I want to write a jQuery function that will return only a part of a given text. For example, in the text: http://somesubdomain.somesite.com/ How can I write a function so that it returns the text "somesubdomain"? In other words, I want to "subtract" the text "http://" and ".somesite.com/". Thanks in advance

    Read the article

  • Sending and treating text by get method

    - by ilnur777
    Guys, could you help me with treating text sent with GET method. How to detect and treat line foldings in text? The text is sent from textarea through AJAX using GET method. How to detect line foldings in text when it is sent in GET method? And I want to replace all line foldings with special character for example like "|" before sending to PHP script. How to do it?

    Read the article

  • Binding with custom text in WPF

    - by nihi_l_ist
    Can i write something like this in WPF(i know that this piece of code is wrong, but need to know if there is kind of this construct): <TextBlock Height="50" Text="Test: {Binding Path=MODULE_GUID}" /> Or always to add some text to binding value i must do something like this: <StackPanel Orientation="Horizontal"> <TextBlock Height="50" Text="Test: " /> <TextBlock Height="50" Text="{Binding Path=MODULE_GUID}" /> </StackPanel>

    Read the article

  • Linq To Text Files

    - by j-t-s
    Hi All I have a Text File (Sorry, I'm not allowed to work on XML files :(), and it includes customer records. Each text file looks like: Account_ID: 98734BLAH9873 User Name: something_85 First Name: ILove Last Name: XML Age: 209 etc... And I need to be able to use LINQ to get the data from these text files and just store them in memory. I have seen many Linq to SQL, Linq to BLAH but nothing for Linq to Text. Can someone please help me out abit? Thank you

    Read the article

  • invoke javax.el.MethodExpression from jsf component

    - by marcos
    Hello gurus I have a jsp tag wich takes a javax.el.MethodExpression as attribute: <%@ attribute name="action" required="true" type="javax.el.MethodExpression" rtexprvalue="true" %> within the same tag i have: <h:commandLink action="#{action}"> link text </h:commandLink> I'm getting the following error when i try to click the link: javax.faces.FacesException: #{action}: org.apache.jasper.el.JspMethodNotFoundException: /WEB-INF/tags/pager/pager.tag(17,1) '#{action}' Identity 'action' was null and was unable to invoke is it possible for the commandLink to properly invoke the "action" method?

    Read the article

  • "java.lang.ClassNotFoundException: javax.ejb.EJBObject" when running JAR

    - by Bernhard V
    Hi, I'm getting a "java.lang.ClassNotFoundException: javax.ejb.EJBObject" error when I'm running my application as a JAR file. When running it in Eclipse everything is working fine. The application properly access the main class and the main method. But when it tries to load the application context it cannot resolve a reference to an EJB bean. I then get the following error: Error creating bean with name 'bc' defined in class path resource [blabla.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: javax/ejb/EJBObject at org.springframework.beans.factory.support.BeanDefinitionValueResolver .resolveReference(BeanDefinitionValueResolver.java:275) ... Caused by: java.lang.ClassNotFoundException: javax.ejb.EJBObject I've included all runtime-scoped dependencies with Maven in the JAR file. Do you know any further information regarding this error?

    Read the article

  • Hibernate unknown entity (not missing @Entity or import javax.persistence.Entity )

    - by david99world
    I've got a really simple class... import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name = "users") public class User { @Column(name = "firstName") private String firstName; @Column(name = "lastName") private String lastName; @Column(name = "email") private String email; @Id @GeneratedValue(strategy=GenerationType.AUTO) @Column(name = "id") private long id; public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public long getId() { return id; } public void setId(long id) { this.id = id; } } I call it using... public class Main { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub HibernateUtil.buildSessionFactory(); Session session = HibernateUtil.getSessionFactory().getCurrentSession(); session.beginTransaction(); User u = new User(); u.setEmail("[email protected]"); u.setFirstName("David"); u.setLastName("Gray"); session.save(u); session.getTransaction().commit(); System.out.println("Record committed"); session.close(); } } I keep getting... Exception in thread "main" org.hibernate.MappingException: Unknown entity: org.assessme.com.entity.User at org.hibernate.internal.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:1172) at org.hibernate.internal.SessionImpl.getEntityPersister(SessionImpl.java:1316) at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:117) at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:204) at org.hibernate.event.internal.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:55) at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:189) at org.hibernate.event.internal.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:49) at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:90) at org.hibernate.internal.SessionImpl.fireSave(SessionImpl.java:670) at org.hibernate.internal.SessionImpl.save(SessionImpl.java:662) at org.hibernate.internal.SessionImpl.save(SessionImpl.java:658) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.hibernate.context.internal.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:352) at $Proxy4.save(Unknown Source) at Main.main(Main.java:20) hibernateUtil is... import org.hibernate.SessionFactory; import org.hibernate.cfg.Configuration; import org.hibernate.service.ServiceRegistry; import org.hibernate.service.ServiceRegistryBuilder; public class HibernateUtil { private static SessionFactory sessionFactory; private static ServiceRegistry serviceRegistry; public static SessionFactory buildSessionFactory() { try { // Create the SessionFactory from hibernate.cfg.xml Configuration configuration = new Configuration(); configuration.configure(); serviceRegistry = new ServiceRegistryBuilder().applySettings(configuration.getProperties()).buildServiceRegistry(); return new Configuration().configure().buildSessionFactory(serviceRegistry); } catch (Throwable ex) { // Make sure you log the exception, as it might be swallowed System.err.println("Initial SessionFactory creation failed." + ex); throw new ExceptionInInitializerError(ex); } } public static SessionFactory getSessionFactory() { sessionFactory = new Configuration().configure().buildSessionFactory(serviceRegistry); return sessionFactory; } } does anyone have any ideas as I've looked at so many duplicates but the resolutions don't appear to work for me. hibernate.cfg.xml shown below... <?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <!-- Database connection settings --> <property name="connection.driver_class">com.mysql.jdbc.Driver</property> <property name="connection.url">jdbc:mysql://localhost/ssme</property> <property name="connection.username">root</property> <property name="connection.password">mypassword</property> <!-- JDBC connection pool (use the built-in) --> <property name="connection.pool_size">1</property> <!-- SQL dialect --> <property name="dialect">org.hibernate.dialect.MySQLDialect</property> <!-- Enable Hibernate's automatic session context management --> <property name="current_session_context_class">thread</property> <!-- Disable the second-level cache --> <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property> <!-- Echo all executed SQL to stdout --> <property name="show_sql">true</property> <!-- Drop and re-create the database schema on startup --> <property name="hbm2ddl.auto">update</property> </session-factory> </hibernate-configuration>

    Read the article

  • HTML to 'pretty' text conversion for printing on text only printer (dot matrix)

    - by Gala101
    Hi, I have a web-site that generates some simple tabular data as html tables, many of my users print the web-page on a laser/inkjet printer; however some like to print on legacy Dot Matrix printers (text only) and there-in lies the problem. When giving Print from web-browser onto dot-matrix printer, the printer actually perceives data as 'graphic'/image and proceeds to print it dot-by-dot. i.e If printing a character 'C', printer slices it horizontally and prints in 3-4 passes. Same printer prints a text from an ASCII file (say from notepad) as complete characters in single pass, thereby being 5 times faster and much quieter than when printing a web-page. (Even tried 'generic text-only driver' but Mozilla Firefox has a know bug that it does not print anything over this particular driver since 2.0+) So is there some clean way of formatting an already generated HTML (say method takes the entire html table as string) and generates a corresponding text file with properly aligned columns? I have tried stripping the html tags, but the major issue there is performing good 'wrapping' of a cell's data and maintaining integrity of other cells' data (from same row). eg: ( '|' and '_' not really required) Col1 | Col2 | Colum_Name3 | Col4 | _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1 | this cell | this column | smaller | | is in three| spans 2 rows | | | rows | | | - - - - - - - - - - - - - - - - - - - - - - - - 2 | smaller now| this also | but this| | | | cell's | | | | data is | | | | now | | | | bigger | _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Could you please suggest preferred approach? I've thought of using xslt and somehow outputting text (instead of more prevalent pdf), but Apache FOP's text renderer is really broken and perhaps forgotten in development path. Commercial one's are way too costly.

    Read the article

  • Javax Swing Timer Help

    - by kap
    Hello Guys, I am having some problems concerning starting javax.swing.Timer after a mouse click. I want to start the timer to perform some animation after the user clicks on a button but it is not working. Here are the code snippets: public class ShowMe extends JPanel{ private javax.swing.Timer timer; public ShowMe(){ timer = new javax.swing.Timer(20, new MoveListener()); } // getters and setters here private class MoveListener implements ActionListener { public void actionPerformed(ActionEvent e) { // some code here to perform the animation } } } This is the class which contains a button so that when the user clicks on the button the timer starts to begin the animation public class Test{ // button declarations go here and registering listeners also here public void actionPerformed(ActionEvent e) { if(e.getSource() == this.btnConnect){ ShowMe vis = new ShowMe(); vis.getTimer().start(); } } } I want to start the timer to begin the animation but it is not working. Need help how to make a timer start after button click. Thanks.

    Read the article

  • How to escape spaces in .desktop files Exec line

    - by nh2
    I want to make a .desktop file like described here. [Desktop Entry] Name=Sublime Text 2 GenericName=Sublime Text 2 Comment=Edit text files Exec=/home/user/opt/sublime/Sublime Text 2/sublime_text %U However, running that from Nautilus's context menu using Open with this gives me Could not find '/home/user/opt/sublime/Sublime' So I tried Exec="/home/user/opt/sublime/Sublime Text 2/sublime_text" %U and got Text ended before matching quote was found for ". (The text was '"/home/user/opt/sublime/Sublime') What is the correct way to escape spaces in the Exec line of .desktop files?

    Read the article

  • Error on clicking on Text to Speech tab in Speech properties in Control Panel

    - by iceman
    When I click on Text to Speech tab in Speech properties I receive error: "C:\WINDOWS\system32\shell32.dll,Control_RunDLL "C:\Program Files\Common Files\Microsoft Shared\Speech\sapi.cpl",Speech". There's a hotfix mentioned the the KBs in MS support.For that MS sent me a password protected file ; 170483_ENU_i386_zip.exe which contained two files : WindowsXP-KB838659-x86-ENU.EXE and WINDOWSXP-KB838659-X86-ENU-Symbols.EXE . The first one did not install as it said i already had it and the second one unpacked some dlls which i don't know how to use. I also tried Re-registering sapi.dll on Windows XP using C:\Windows\System32\regsvr32.exe Is there any other fix to this error?

    Read the article

  • Fixing Corrupted Text

    - by oort
    I Have text which looks like this: supposed to undergo yearly cardiac exam in order to stay on transplant list. But, there are patients who are missing important cardiac information. It is yo ur job as an intern on call to make sure that you fin As you can see, the first line is fine, but then the second line is corrupt. It looks like this even when I open it using Vim or LibreOffice. Is there a way to fix this? I've tried changing the encoding to UTF-8 but to no avail. Thanks!

    Read the article

  • Text Terminal Hardware (for Linux)

    - by DLH
    Is there any way to obtain a hardware text terminal (preferably small in size) with a screen and a keypad to connect to a Linux machine (preferably via usb)? I'd like to be able to log into a command line and do some work there while simultaneously running a graphical environment on the main display. It seems like there should be some kind of lcd screen and qwerty keypad device designed for this purpose. Does this exist, and how do I get one? Edit: I'd be happy with a small networked device as well, as long as I could get a remote terminal into my computer.

    Read the article

  • vim command palette, similar to sublime text

    - by user137369
    In sublime text, we can press ??P to bring up the command palette. Are there any similar tools for vim? I’ve been trying vim-ctrlp-cmdpalette, and although it works relatively well (there are some small issues), it depends on ctrlp (not a huge problem), and it looks like it won’t see much development (it has 14 commits over the course of 3 days, 5 months ago, for an “Initial experimental version”), so I was wondering if there are any known alternatives, since searching for “vim command palette” is a bit limiting; maybe there are some other terms more appropriate for this.

    Read the article

  • Mac OS X - Quickly change voices for Text-to-Speech

    - by Roman Geber
    I love the text to Speech feature of Mac OS X. Since I'm not a native English speaker I'm very happy about all the additional languages added since Lion came out. However, I do use English as well as my native language (German). Changing voices is a bit of a pain. It just requires too many steps to be comfortable. Is there any way to make this easy? I was looking for shortcuts, maybe a drop down menu somwhere up in the right corner, anything would be fine. Since my search was not successful, I hope to find some advice here on SuperUser. Thanks a lot! cu Roman

    Read the article

  • How to build compass in sublime text 2

    - by aurel
    I downloaded this package which allows use to build compass in though sublime text by pressing cmd+b. I created a sass file, made sure compass is selected from the tools build system compass menu. But when I press cmd+b the file does not compile and I get no error. I only get [Finished in 0.0s with exit code 1]. However I also tested to build the code with sass (tools build system sass) and it works fine. Do I need to do anything to the sass file for compass to work. Thanks

    Read the article

  • Change default text editor for crontab to vim

    - by Max Williams
    I'm using ubuntu 9.10 and the default text editor is nano, which i hate. (doesn't everyone?) Normally it's not a problem as i just vi or gedit everything but crontab -e is opening with nano. I tried changing it to vim using sudo update-alternatives --config editor and selecting option 3 ("/usr/bin/vim.basic"). This has changed it for sudo and non-sudo alike. But crontab -e still opens nano. Any ideas? max

    Read the article

  • Deleting entire lines in a text file based on a partial string match with Windows PowerShell

    - by Charles
    So I have several large text files I need to sort through, and remove all occurrences of lines which contain a given keyword. So basically, if I have these lines: This is not a test This is a test Maybe a test Definitely not a test And I run the script with 'not', I need to entirely delete lines 1 and 4. I've been trying with: PS C:\Users\Admin> (Get-Content "D:\Logs\co2.txt") | Foreach-Object {$_ -replace "3*Program*", ""} | Set-Content "D:\Logs\co2.txt" but it only replaces the 'Program' and not the entire line.

    Read the article

  • MouseMotionListener inside JTable

    - by Harish
    I am trying to add MouseMotion event to the label and move it based on the dragging of the mouse and make it move along with my mouse.However the mousemotion is very difficult to control making this action not usable. Here is the code import java.awt.Color; import java.awt.Component; import java.awt.event.MouseEvent; import java.awt.event.MouseMotionListener; import javax.swing.BorderFactory; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.SwingConstants; import javax.swing.SwingUtilities; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.DefaultTableModel; public class TableTest { public TableTest() { String[] columnNames = { "FileName", "Integer" }; Object[][] data = { { new FileName("AAA.jpg", Color.YELLOW), new Integer(2) }, { new FileName("BBB.png", Color.GREEN), new FileName("BBB.png", Color.GREEN) }, { new FileName("CCC.jpg", Color.RED), new Integer(-1) }, }; DefaultTableModel model = new DefaultTableModel(data, columnNames) { public Class getColumnClass(int column) { System.out.println("column is" + column); return getValueAt(0, column).getClass(); } }; JTable table = new JTable(model); //JTable table = new JTable(data, columnNames); table.setDefaultRenderer(FileName.class, new FileNameCellRenderer()); final JLabel label = new JLabel("TESTING", SwingConstants.CENTER); label.setBackground(java.awt.Color.RED); label.setBounds(450, 100, 90, 20); label.setOpaque(true); label.setVisible(true); label.addMouseMotionListener(new MouseMotionListener() { public void mouseDragged(MouseEvent arg0) { label.setBounds(arg0.getX(), arg0.getY(), 90, 20); } public void mouseMoved(MouseEvent arg0) { // TODO Auto-generated method stub } }); table.add(label); JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().add(table); frame.setSize(800, 600); frame.setLocationRelativeTo(null); frame.setVisible(true); } static class FileNameCellRenderer extends DefaultTableCellRenderer { public Component getTableCellRendererComponent(JTable table, Object v, boolean isSelected, boolean hasFocus, int row, int column) { super.getTableCellRendererComponent(table, v, isSelected, hasFocus, row, column); FileName fn = (FileName) v; setBorder(BorderFactory.createMatteBorder(0, 60, 0, 0, new java.awt.Color(143, 188, 143))); return this; } } static class FileName { public final Color color; public final String label; FileName(String l, Color c) { this.label = l; this.color = c; } public String toString() { return label; } } public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { new TableTest(); } }); } } I just want to make the label follow the label follow my mouse and the label should be attached to the table.Is there an easy way than this.

    Read the article

  • sIFR 3 HTML text does not display, .sIFR-alternate causing problem

    - by Jeremy Schultz
    It seems my sIFR 3 text does not show HTML text if the Flash text is not displayed. Here's one of the pages in question: http://www.jeremyschultz.com/client/orchardplace/website/beta/volunteer/ One person has reported not seeing anything when viewing this page, and I can recreate it by removing the Flash text with Firebug. Testing with Firebug also suggests the .sIFR-alternate class is what's causing this: when I remove it, the text shows up, and it disappears again when I restore it. I copied the original CSS and also tried applying a few new CSS rules to .sIFR-alternate but nothing has solved it. What do you think? Jeremy [email protected]

    Read the article

  • Multiple synonym dictionary matches in PostgreSQL full text searching

    - by Ryan VanMiddlesworth
    I am trying to do full text searching in PostgreSQL 8.3. It worked splendidly, so I added in synonym matching (e.g. 'bob' == 'robert') using a synonym dictionary. That works great too. But I've noticed that it apparently only allows a word to have one synonym. That is, 'al' cannot be 'albert' and 'allen'. Is this correct? Is there any way to have multiple dictionary matches in a PostgreSQL synonym dictionary? For reference, here is my sample dictionary file: bob robert bobby robert al alan al albert al allen And the SQL that creates the full text search config: CREATE TEXT SEARCH DICTIONARY nickname (TEMPLATE = synonym, SYNONYMS = nickname); CREATE TEXT SEARCH CONFIGURATION dxp_name (COPY = simple); ALTER TEXT SEARCH CONFIGURATION dxp_name ALTER MAPPING FOR asciiword WITH nickname, simple; What am I doing wrong? Thanks!

    Read the article

  • Setting the background colour/highlight colour for a given string range using Core Text

    - by Jasarien
    I have some text laid out using Core Text in my iPhone app. I'm using NSAttributedString to set certain styles within the text for given ranges. I can't seem to find an attribute for setting a background / highlight colour, though it would seem it is possible. I couldn't find an attribute name constant that sounded relevant and the documentation only lists: kCTCharacterShapeAttributeName kCTFontAttributeName kCTKernAttributeName kCTLigatureAttributeName kCTForegroundColorAttributeName kCTForegroundColorFromContextAttributeName kCTParagraphStyleAttributeName kCTStrokeWidthAttributeName kCTStrokeColorAttributeName kCTSuperscriptAttributeName kCTUnderlineColorAttributeName kCTUnderlineStyleAttributeName kCTVerticalFormsAttributeName kCTGlyphInfoAttributeName kCTRunDelegateAttributeName Craig Hockenberry, developer of Twitterrific has said publicly on Twitter that he uses Core Text to render the tweets, and Twitterrific has this background / highlight that I'm talking about when you touch a link. Any help or pointers in the right direction would be fantastic, thanks. Edit: Here's a link to the tweet Craig posted mentioning "Core text, attributed strings and a lot of hard work", and the follow up that mentioned using CTFrameSetter metrics to work out if touches intersect with links.

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >