Search Results

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

Page 57/1490 | < Previous Page | 53 54 55 56 57 58 59 60 61 62 63 64  | Next Page >

  • Conky truncates text loaded from file

    - by takeshin
    I'm trying to configure conky on Ubuntu, because I need to display my todo list on the desktop. The the file is displayed, but the text is truncated (not rectangular, just after some character limit). How to display the whole file? Here is my setup: # Text alignment, other possible values are commented alignment top_right # Gap between borders of screen and text gap_x 10 gap_y 10 # Maximum size of buffer for user text, i.e. below TEXT line. max_user_text 16384 # stuff after 'TEXT' will be formatted on screen TEXT ${execi 30 cat /home/user/Documents/todo.txt}

    Read the article

  • Drag and drop with an image

    - by DJClayworth
    I need to create a drag and drop system in swing where an image of the thing being dragged is attached to the cursor during the drag. In theory this is achieveable with public Icon getVisualRepresentation(Transferable t) but there appears to be a long standing bug (here) that means this method is never called. I know I can do it by implementing my own DnD system with DragSource etc., but does anyone know of an easier workround that will get me what I need?

    Read the article

  • Error compiling / linking e text editor on Linux

    - by jckdnk111
    The code compiles without too much complaint, but the last step fails with the error below. There is some discussion about it on the e forum, but still no answer. [LD] e ../external/out.release/lib/libpcre.a(pcre_tables.o):(.rodata+0x0): multiple definition of `_pcre_OP_lengths' .objs.release/cx_pcre_tables.o:(.rodata+0x0): first defined here ../external/out.release/lib/libpcre.a(pcre_tables.o):(.rodata+0x70): multiple definition of `_pcre_utf8_table1' .objs.release/cx_pcre_tables.o:(.rodata+0x70): first defined here ../external/out.release/lib/libpcre.a(pcre_tables.o):(.rodata+0x88): multiple definition of `_pcre_utf8_table1_size' .objs.release/cx_pcre_tables.o:(.rodata+0x88): first defined here ../external/out.release/lib/libpcre.a(pcre_tables.o):(.rodata+0x8c): multiple definition of `_pcre_utf8_table2' .objs.release/cx_pcre_tables.o:(.rodata+0x8c): first defined here ../external/out.release/lib/libpcre.a(pcre_tables.o):(.rodata+0xa4): multiple definition of `_pcre_utf8_table3' .objs.release/cx_pcre_tables.o:(.rodata+0xa4): first defined here ../external/out.release/lib/libpcre.a(pcre_tables.o):(.rodata+0xc0): multiple definition of `_pcre_utf8_table4' .objs.release/cx_pcre_tables.o:(.rodata+0xc0): first defined here ../external/out.release/lib/libpcre.a(pcre_tables.o):(.rodata+0x180): multiple definition of `_pcre_utt_names' .objs.release/cx_pcre_tables.o:(.rodata+0x100): first defined here /usr/bin/ld: Warning: size of symbol `_pcre_utt_names' changed from 657 in .objs.release/cx_pcre_tables.o to 740 in ../external/out.release/lib/libpcre.a(pcre_tables.o) ../external/out.release/lib/libpcre.a(pcre_tables.o):(.rodata+0x480): multiple definition of `_pcre_utt' .objs.release/cx_pcre_tables.o:(.rodata+0x3a0): first defined here /usr/bin/ld: Warning: size of symbol `_pcre_utt' changed from 630 in .objs.release/cx_pcre_tables.o to 696 in ../external/out.release/lib/libpcre.a(pcre_tables.o) ../external/out.release/lib/libpcre.a(pcre_tables.o):(.rodata+0x738): multiple definition of `_pcre_utt_size' .objs.release/cx_pcre_tables.o:(.rodata+0x618): first defined here .objs.release/cx_pcre_exec.o: In function `match(doc_byte_iter, unsigned char const*, doc_byte_iter, int, match_data*, unsigned long, eptrblock*, int, unsigned int)': cx_pcre_exec.cpp:(.text+0x1c2a): undefined reference to `_pcre_ord2utf8(int, unsigned char*)' .objs.release/eauibook.o: In function `eAuiNotebook::LoadPerspective(wxString const&)': eauibook.cpp:(.text+0x9ad): undefined reference to `wxTabFrame::SetTabCtrlHeight(int)' .objs.release/PreviewDlg.o: In function `global constructors keyed to _ZN10PreviewDlg13sm_eventTableE': PreviewDlg.cpp:(.text+0x11b2): undefined reference to `wxEVT_WEB_TITLECHANGE' PreviewDlg.cpp:(.text+0x11ee): undefined reference to `wxEVT_WEB_DOMCONTENTLOADED' .objs.release/PreviewDlg.o: In function `PreviewDlg::RefreshBrowser(PreviewDlg::cxUpdateMode)': PreviewDlg.cpp:(.text+0x2a47): undefined reference to `wxWebControl::OpenURI(wxString const&, unsigned int, wxWebPostData*, bool)' .objs.release/PreviewDlg.o: In function `PreviewDlg::OnWebDocumentComplete(wxWebEvent&)': PreviewDlg.cpp:(.text+0x3259): undefined reference to `wxWebControl::GetCurrentURI() const' .objs.release/PreviewDlg.o: In function `PreviewDlg::PreviewDlg(EditorFrame&)': PreviewDlg.cpp:(.text+0x4984): undefined reference to `wxWebControl::IsInitialized()' PreviewDlg.cpp:(.text+0x49c5): undefined reference to `wxWebControl::wxWebControl(wxWindow*, int, wxPoint const&, wxSize const&)' PreviewDlg.cpp:(.text+0x562f): undefined reference to `wxWebControl::InitEngine(wxString const&)' .objs.release/PreviewDlg.o: In function `PreviewDlg::PreviewDlg(EditorFrame&)': PreviewDlg.cpp:(.text+0x68e4): undefined reference to `wxWebControl::IsInitialized()' PreviewDlg.cpp:(.text+0x6925): undefined reference to `wxWebControl::wxWebControl(wxWindow*, int, wxPoint const&, wxSize const&)' PreviewDlg.cpp:(.text+0x758f): undefined reference to `wxWebControl::InitEngine(wxString const&)' .objs.release/PreviewDlg.o: In function `PreviewDlg::OnButtonForward(wxCommandEvent&)': PreviewDlg.cpp:(.text+0x132): undefined reference to `wxWebControl::GoForward()' .objs.release/PreviewDlg.o: In function `PreviewDlg::OnButtonBack(wxCommandEvent&)': PreviewDlg.cpp:(.text+0x182): undefined reference to `wxWebControl::GoBack()' ../ecore/libecore.so(cxInternal.o): In function `cxInternal::MoveOldSettings(eSettings&)': cxInternal.cpp:(.text+0x4d29): undefined reference to `eSettings::SetPageSettings(unsigned int, wxString const&, doc_id, int, int, wxString const&, std::vector<unsigned int, std::allocator<unsigned int> > const&, std::vector<cxBookmark, std::allocator<cxBookmark> > const&, eSettings::SubPage)' collect2: ld returned 1 exit status make: *** [e] Error 1 EDIT: Forgot the link http://github.com/etexteditor/e

    Read the article

  • Java - Lock Aspect Ratio of JFrame

    - by nasufara
    Is it possible to lock the aspect ratio of a JFrame in Java Swing? For example, if my window is 200px by 200px, and the user wants to resize it, I want the ratio between the width and the height at 1:1, so that if the new width is 400px, the new height is forced to 400px. I'm aware of ComponentListener and componentResized, but I'm having difficulty not getting it to go into an infinite loop of resizing, because I'm resizing the window in a resize listener. Thanks!

    Read the article

  • Freeze columns in JXTable

    - by black-rocky
    I'd like to be able to freeze columns in JXTable just like in Excel spreadsheet and came across this project: xframe-swing's JXTable. Just wondering if there is a tutorial for this project. Note that this is not the same as JXTable in swingx project. Or perhaps there is another way?

    Read the article

  • Force repaint after button click

    - by coubeatczech
    consider this piece of scala swing code detail.reactions +={ case ButtonClicked(but) = detail.contents += new Label(but.text) detail.background = new java.awt.Color(0,255,0) } the detail is of FlowPanel type. When the button is clicked, the color is instantly repainted, but the Label is not. It gets visible as I click the area. How can I force the detail to repaint its contents after a click?

    Read the article

  • How to convert html textfield/area data to server-side txt file? [closed]

    - by olijake
    How can I make a script that will convert the text/data in a html textfield/textarea and send it to the server, which then saves it as a .txt file for storage? NOTE: I am hosting a website(for testing purposes) using Apache 2.2 on a Windows 7 machine. I downloaded PHP version 5.4.7, but have not yet installed on my server yet (not sure if I will need it, but also not sure how to install it). 1st problem: Saving text to server Html page/section with title textfield, text textarea, and submit button. You would enter a title, the text/notes you need in the textfield, then press the submit button to have it store the text in the textarea, as a .txt file on the server called .txt. 2nd problem: Opening text from server Html with list of all txt files OR textfield for entering in title, then submit button to send the title of the requested .txt file to the server, which would then load it up on the page. Here is what I have so far: (let me know if there is something that I should change or if something just isn't correct in the index.html code I have right now.) <!DOCTYPE HTML> <html> <head> <title>Insert Title</title> <meta http-equiv="Content-Type" content="Text/HTML; charset=UTF-8"/> </head> <body> <form method="post" action="save.INSERT_FILETYPE" name="textfile" enctype="multipart/form-data"> <input type="text" name="title"><br/> <textarea rows="20" cols="100" id="text" name="text"></textarea><br/> <input type="submit" name="submit" value="Submit Text to Server"> </form><br/> <hr style="width: 100%; height: 4px;"><br/> <form method="post" action="open.INSERT_FILETYPE" name="textfile" enctype="multipart/form-data"> <input type="text" name="title"><br/> <input type="submit" name="submit" value="Submit Txt File Request"> </form><br/> <div>Opened text file displays here or goes on another page</div> </body> </html> I plan on using a server side language/script, but ANYTHING that gets the job done is fine. I already tried looking into using some ASP/jScript/PHP, but have had some trouble implementing it into my server. (ie: getting the modules loaded and telling the server what file types to parse.) I know this may be an extremely easy fix, but then in that case, hopefully you wouldn't mind helping me out a little :). If it turns out that this is MUCH more complicated than I expect, then feel free to let me know that, so I don't waste me time running in circles. I appreciate any help/assistance that you can provide, Thanks, Jake EDIT: Wrong Apache version. In response to the comments/closing of this thread: My question: "How exactly do I install the PHP module on the apache server? and is this even possible? and is this even recommended?" ^ In case I wasn't clear enough already To Clarify: I understand the basics of PHP, I just have trouble with INSTALLING PHP on the apache server. (I have used PHP before, but never successfully on apache (so far...)) For my script I wrote something similar to this already (using fopen() and a few other commands): <?php fopen("notes.txt", "r"); file_put_contents("notes.txt",teststring1); ?> I have used javascript for this task before also (although I prefer using PHP and server-side languages): <script language="javascript"> function WriteToFile(){ var fso = new ActiveXObject("Scripting.FileSystemObject"); var s = fso.CreateTextFile("C:\\NewFile.txt", true); var text=document.getElementById("TextArea1").innerText; s.WriteLine(text); s.WriteLine('***********************'); s.Close(); } </script>

    Read the article

  • Using AWT components inside a JInnerFrame (for JDesktopPane)

    - by Jack
    Hello, is there a way to hack bugs related to adding an AWT component (in my case a PApplet, so a processing language sketch) inside a JInternalFrame? It works but not as intended, since it flickers and dragging the frame causes repaint issues.. reading around it seems that, althrough it's possible to mix heavyweight (AWT) and lightweight (Swing) components some problems seem to be unavoidable.. is it true? Thanks!

    Read the article

  • DropDownList Value not changing with UpdatePanel and ModalPopupExtender

    - by Richard
    Greetings, I have an asp.net webpage with an modalpopupextender inside of an updatepanel. When I click Ok on the popup, I can get the textbox values from the popup just fine, but the DropDownLists have the old/default value, not the new value I have selected for them. All the controls on the popup are set to enableviewstate = true, and autopostback = false (I just want to make the trip to the server when I click the ok button, not every time I change the value of the popups). Here is the relevant code. ========================== Client Side <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Panel ID="EditIssuePanel" runat="server" CssClass="modalPopup" Style="display:block;" > <table style="width:500px;"> <tr style="height:50px;"> <td colspan="2" align="center"> <asp:Label ID="lblEditIssueHeader" runat="server" Text="Edit Issue"></asp:Label> </td> </tr> <tr style="height:30px;"> <td class="labelscolumn"> <asp:Label ID="lblIssueName" runat="server" Text="Name:"></asp:Label> </td> <td class="datacolumn"> <asp:TextBox ID="txtName" runat="server" Width="250px" MaxLength="50"></asp:TextBox> </td> </tr> <tr style="height:30px;"> <td class="labelscolumn"> <asp:Label ID="lblDescription" runat="server" Text="Description:"></asp:Label> </td> <td class="datacolumn"> <asp:TextBox ID="txtDescription" runat="server" Width="250px" MaxLength="1000"></asp:TextBox> </td> </tr> <tr style="height:30px;"> <td class="labelscolumn"> <asp:Label ID="lblType" runat="server" Text="Type:"></asp:Label> </td> <td class="datacolumn"> <asp:DropDownList ID="ddlType" runat="server"> <asp:ListItem Selected="True" Value="B">Bug</asp:ListItem> <asp:ListItem Value="R">Request</asp:ListItem> <asp:ListItem Value="O">Other</asp:ListItem> </asp:DropDownList> </td> </tr> <tr style="height:30px;"> <td class="labelscolumn"> <asp:Label ID="lblStatus" runat="server" Text="Status:"></asp:Label> </td> <td class="datacolumn"> <asp:DropDownList ID="ddlStatus" runat="server"> <asp:ListItem Selected="True" Value="L">Logged</asp:ListItem> <asp:ListItem Value="I">In Process</asp:ListItem> <asp:ListItem Value="C">Complete</asp:ListItem> </asp:DropDownList> &nbsp; </td> </tr> <tr style="height:30px;"> <td class="labelscolumn"> <asp:Label ID="lblPriority" runat="server" Text="Priority:"></asp:Label> </td> <td class="datacolumn"> <asp:DropDownList ID="ddlPriority" runat="server" EnableViewState="true" AutoPostBack="false"> <asp:ListItem Selected="True" Value="L">Low</asp:ListItem> <asp:ListItem Value="M">Medium</asp:ListItem> <asp:ListItem Value="H">High</asp:ListItem> </asp:DropDownList> &nbsp;</td> </tr> <tr style="height:30px"> <td class="labelscolumn">Logger</td> <td class="datacolumn"> <asp:Label ID="lblEnteredByClientUserID" runat="server" Text=""></asp:Label> </td> </tr> <tr style="height:30px;"> <td class="labelscolumn"> <asp:Label ID="lblDateResolutionRequested" runat="server" Text="Requested Complete Date:"></asp:Label> </td> <td class="datacolumn"> <igsch:WebDateChooser ID="wdcRequestCompleteDate" runat="server"> </igsch:WebDateChooser> &nbsp;</td> </tr> <tr style="height:30px"> <td class="labelscolumn">Logged Date</td> <td class="datacolumn"> <asp:Label ID="lblLoggedDate" runat="server" Text=""></asp:Label> </td> </tr> <tr style="height:30px"> <td class="labelscolumn">In Process Date</td> <td class="datacolumn"> <asp:Label ID="lblInProcessDate" runat="server" Text=""></asp:Label> </td> </tr> <tr style="height:30px"> <td class="labelscolumn">Resolved Date</td> <td class="datacolumn"> <asp:Label ID="lblResolvedDate" runat="server" Text=""></asp:Label> </td> </tr> <tr style="height:30px;"> <td class="labelscolumn" valign="top"> <asp:Label ID="lblEmailCCList" runat="server" Text="Email CC:"></asp:Label> </td> <td class="datacolumn"> <asp:TextBox ID="txtEmailCCList" runat="server" MaxLength="2000" Rows="0" TextMode="MultiLine" Height="83px" Width="250px"></asp:TextBox> &nbsp;</td> </tr> <tr> <td> <asp:Label ID="lblIssueID" runat="server" Text="" Visible="false"></asp:Label> <asp:Label ID="lblClientID" runat="server" Text="" Visible="false"></asp:Label> </td> <td align="right"> <asp:Button ID="btnEditOk" runat="server" Text="Ok" onclick="btnEditOk_Click"/>&nbsp;&nbsp; <asp:Button ID="btnEditCancel" runat="server" Text="Cancel" onclick="btnEditCancel_Click" />&nbsp;&nbsp;&nbsp;&nbsp; </td> </tr> </table> </asp:Panel> . . . THEN THERE IS A WEBGRID HERE. . . This modal popupextender here got mangled. I cant get stackoverflow to show it right. It shows the properties here though. " BackgroundCssClass="modalBackground" DropShadow="true" OkControlID="btnEditOk" CancelControlID="btnEditCancel" Animations="" </ContentTemplate> </asp:UpdatePanel> ========================================= Server Side protected void btnEditOk_Click(object sender, EventArgs e) { IssueDAO issueDAO = new IssueDAO(); string client = "Eichleay"; string name = null; string description = null; string type = null; string status = null; DateTime? resolvedDate = null; string enteredByClientUserName = User.Identity.Name.ToString(); DateTime? loggedDate = DateTime.Now; DateTime? inProcessDate = null; DateTime? completeDate = null; DateTime? requestCompleteDate = null; string priority = null; int? prioritySort = null; string emailCCList = null; name = txtName.Text.Substring(txtName.Text.Length > 0 ? 1 : 0, (txtName.Text.Length > 0 ? txtName.Text.Length : 1) - 1); description = txtDescription.Text.Substring(txtDescription.Text.Length > 0 ? 1 : 0, (txtDescription.Text.Length == 0 ? 1 : txtDescription.Text.Length) - 1); type = ddlType.SelectedValue; status = ddlStatus.SelectedValue; resolvedDate = string.IsNullOrEmpty(lblResolvedDate.Text) == true ? null : new Nullable<DateTime>(Convert.ToDateTime(lblResolvedDate.Text)); inProcessDate = string.IsNullOrEmpty(lblInProcessDate.Text) == true ? null : new Nullable<DateTime>(Convert.ToDateTime(lblInProcessDate.Text)); completeDate = string.IsNullOrEmpty(lblResolvedDate.Text) == true ? null : new Nullable<DateTime>(Convert.ToDateTime(lblResolvedDate.Text)); requestCompleteDate = wdcRequestCompleteDate.Value == null ? null : string.IsNullOrEmpty(wdcRequestCompleteDate.Value.ToString()) == true ? null : new Nullable<DateTime>(Convert.ToDateTime(wdcRequestCompleteDate.Value.ToString())); priority = ddlPriority.SelectedValue; emailCCList = txtEmailCCList.Text.Substring(txtEmailCCList.Text.Length > 0 ? 1 : 0, (txtEmailCCList.Text.Length > 0 ? txtEmailCCList.Text.Length : 1) - 1); if (lblEditIssueHeader.Text.Substring(0, 3) == "New") { issueDAO.InsertIssue(client, name, description, type, status, resolvedDate, enteredByClientUserName, loggedDate, inProcessDate, completeDate, requestCompleteDate, priority, prioritySort, emailCCList); } else { Issue issue = new Issue(Convert.ToInt32(lblIssueID.Text), lblClientID.Text, txtName.Text.Substring(txtName.Text.Length > 0 ? 1 : 0, (txtName.Text.Length > 0 ? txtName.Text.Length : 1) - 1), txtDescription.Text.Substring(txtDescription.Text.Length > 0 ? 1 : 0, (txtDescription.Text.Length == 0 ? 1 : txtDescription.Text.Length) - 1), ddlType.SelectedValue, ddlStatus.SelectedValue, string.IsNullOrEmpty(lblResolvedDate.Text) == true ? null : new Nullable<DateTime>(Convert.ToDateTime(lblResolvedDate.Text)), lblEnteredByClientUserID.Text, string.IsNullOrEmpty(lblLoggedDate.Text) == true ? null : new Nullable<DateTime>(Convert.ToDateTime(lblLoggedDate.Text)), string.IsNullOrEmpty(lblInProcessDate.Text) == true ? null : new Nullable<DateTime>(Convert.ToDateTime(lblInProcessDate.Text)), string.IsNullOrEmpty(lblResolvedDate.Text) == true ? null : new Nullable<DateTime>(Convert.ToDateTime(lblResolvedDate.Text)), string.IsNullOrEmpty(wdcRequestCompleteDate.Value.ToString()) == true ? null : new Nullable<DateTime>(Convert.ToDateTime(wdcRequestCompleteDate.Value.ToString())), ddlPriority.SelectedValue, null, txtEmailCCList.Text.Substring(txtEmailCCList.Text.Length > 0 ? 1 : 0, (txtEmailCCList.Text.Length > 0 ? txtEmailCCList.Text.Length : 1) - 1)); issueDAO.UpdateIssue(issue); } // wdgIssues.ClearDataSource(); // UpdatePanel1.Update(); lblIssueID.Text = null; lblClientID.Text = null; txtName.Text = null; txtDescription.Text = null; ddlType.SelectedValue = null; ddlStatus.SelectedValue = null; lblLoggedDate.Text = null; lblInProcessDate.Text = null; lblResolvedDate.Text = null; wdcRequestCompleteDate.Value = null; ddlPriority.SelectedValue = null; txtEmailCCList.Text = null; }

    Read the article

  • StringBounds of htmlized string

    - by pavan
    Hi, Is it possible to calculate the bounds of a htmlized String in Java Swing? I tried using the BasicHtml.createHTMLView, but kept getting the same prefSpan; irrespective of the component font. Regards, Pavan

    Read the article

  • Focused animation on custom JDialog

    - by n002213f
    If a JFrame has a JDialog modal open, the JDialog is animated (the borders and title bar have a lighter colour) if any other part of the application is clicked other than the JDialog with focus. The user is made aware of the window in focus to attend to first. I have a Swing application with custom dialogs, setUndecorated(true) and custom title bars. Is it possible to implement the behaviour described above for these custome dialogs?

    Read the article

  • pop a frame

    - by somya agrawal
    I am working on a project (Java, Swing) in which i have to pop a frame on clicking a hyperlink. but the coding for the frame and all its components is done in a different class and that hyperlink exists in a different class. what shall i do to pop that frame on clicking of the hyperlink please tell. thanks.

    Read the article

  • Get rid of wasted/unused space in a JMenu

    - by Trevor Harrison
    In my app, I've got a menu bar with a File menu. In the submenus, each JMenuItem is wasting a lot of white space to the left of the text for a checkbox (I think), even though I'm not including any JCheckBoxMenuItems. I'm seeing lots of other java/swing apps who's menus don't waste this space. How do I do it in my app?

    Read the article

  • Word is ignoring my 'Match Destination Formatting' preference when pasting text

    - by CreeDorofl
    I'm stuck using word 2007 at the office. It has options for retaining formatting, pasting as plain text, and pasting text to match the destination's formatting. That last option is the one I want, but word is blatantly ignoring it. I copy some text from a PDF, paste into word, and it retains the PDF's formatting... even though I went into options -- advanced -- changed all the dropdowns to "Match Destination Formatting". It also ignores "text only" option... It retains the exact mix of bold, italic, normal text & fonts. I can work around it by pasting to a plain text file, then pasting into word. Or I can do paste special -- unformatted text. But this is so irritating... I just want to ctrl+V and not hassle with it every single time. Is there a better fix?

    Read the article

  • Custom Monitor Resolution not recognized by Java

    - by Angie
    My weird monitor's native resolution isn't recognized by Windows, so I have to set a custom resolution for it. The problem is that java doesn't recognize it since it's not on Win7's "approved" list, so full-screen mode gets "stuck". Netbeans comes out of full-screen fine, so there has to be a way around this. Anyone know it? This example reproduces the issue: package resolutionexample; import java.awt.Dimension; import java.awt.DisplayMode; import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; import javax.swing.JFrame; import javax.swing.SwingUtilities; public class Main { public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable(){ public void run() { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice gd = ge.getDefaultScreenDevice(); DisplayMode currentDM = gd.getDisplayMode(); boolean currentInAvailable = false; System.out.println("Available resolutions:"); for ( DisplayMode availDM : gd.getDisplayModes() ){ //System.out.println(availDM.getWidth() + "x" + availDM.getHeight()); if ( availDM.equals(currentDM) ){ currentInAvailable = true; } } System.out.println("Current resolution: " + currentDM.getWidth() + "x" + currentDM.getHeight() ); System.out.println("Current in available: " + currentInAvailable); JFrame frame = new JFrame("Resolution Bug Example"); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); if ( !gd.isFullScreenSupported() ){System.exit(0);} gd.setFullScreenWindow(frame); gd.setFullScreenWindow(null); } }); } } Output running 1680x1050 (the monitor's wonky native resolution): run: Available resolutions: Current resolution: 1680x1050 Current in available: false Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Invalid display mode at sun.awt.Win32GraphicsDevice.setDisplayMode(Win32GraphicsDevice.java:393) at sun.awt.Win32GraphicsDevice.setFullScreenWindow(Win32GraphicsDevice.java:329) at resolutionexample.Main$1.run(Main.java:43) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:597) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) BUILD SUCCESSFUL (total time: 2 seconds) Output if I set my resolution to 1024x768 before running: run: Available resolutions: Current resolution: 1024x768 Current in available: true BUILD SUCCESSFUL (total time: 2 seconds)

    Read the article

  • manipulating strings, search text

    - by alhambraeidos
    Hi all, I try explain my issue: note 1: I have only strings, not files, ONLY strings. I have a string like this (NOTE: I include line numbers for better explain) The line separator is \r\n (CRLF) string allText = 1 Lorem ipsum Lorem ipsum 2 == START 001partXXX.sql == 3 Lorem ipsum TEXT Lorem ipsum 4 == END 001partXXX.sql == 5 Lorem ipsum TEXT Lorem ipsum 6 == START 002partzzz.sql == 7 Lorem ipsum TEXT Lorem ipsum 8 == END 002partzzz.sql == I have contents strings like this: string contents1 = == START 001partXXX.sql == Lorem ipsum TEXT Lorem ipsum == END 001partXXX.sql == the other content string: string contents2 = == START 002partzzz.sql == Lorem ipsum TEXT Lorem ipsum == END 002partzzz.sql == Then, allText.IndexOf(contents1) != -1 allText.IndexOf(contents2) != -1 I need function thats receive 3 parameters: allText, Contents, and text to find in contents, and it returns the line number of Text To Find in AllText For example, input: allText, contents2, "TEXT" ouput = line number 7 Another sample, input: allText, contents1, "TEXT" ouput = line number 3 Another sample, input: allText, contents1, "TEXT NOT FOUND" ouput = line number -1 How can I implement this function ?? any help very useful for me, Thanks in advanced.

    Read the article

  • Exceptions and web services

    - by Schildmeijer
    Im using the standard java ws implementation shipped with e.g. java6 (javax.jws.*). I have the following: import javax.jws.*; @WebService(name="Widget") public interface Widget { @WebMethod public @WebResult String getGadget(@WebParam(name = "id") long id) throw MyOwnException; } Is this possible? Do I have to annotate MyOwnException with e.g the @WebFault annotation? During my initial tests I also noticed that, on the client side, the autogenerated MyOwnException was renamed to MyOwnException_Exception and wrapped the "original" MyOwnException. Or if this is a bad idea, are there any recommended Exceptions to throw from a webservice like this?

    Read the article

  • Java - How to set focus the already running application ?

    - by Brad
    I am using a ServerSocket port to run one instance only of my Java Swing application, so if a user tries to open another instance of the program, i show him a warning that "Another instance is already open". This works fine, but instead of showing this message i want to set focus on the running application itself, like some programs does (MSN Messenger), even if it was minimized. Is there a solution for this for various operating systems ?

    Read the article

< Previous Page | 53 54 55 56 57 58 59 60 61 62 63 64  | Next Page >