TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: MARTIN GREGORIE
from: ALISTER
date: 2018-09-20 21:02:00
subject: Re: Displaying a ragged a

On Thu, 20 Sep 2018 17:56:54 +0000, Martin Gregorie wrote:

> On Thu, 20 Sep 2018 17:23:21 +0100, Adrian Caspersz wrote:
>
>> On 19/09/18 14:55, Martin Gregorie wrote:
>>> On Wed, 19 Sep 2018 14:02:13 +0100, Adrian Caspersz wrote:
>>>
>>>> On 16/09/18 19:17, Martin Gregorie wrote:
>>>>> I'm in the process of creating a desktop application to display and
>>>>> edit data that's best treated as a ragged array of Strings: it is
>>>>> quite unlikely that all rows in the array will be the same length.
>>>>>
>>>>> I've built and debugged a Datastore class to hold it as an ArrayList
>>>>> of ArrayList  - the ArrayList being in a wrapper
>>>>> class representing a row of fields. The DataStore allows rows,
>>>>> columns and individual fields to be inserted, deleted, and the
>>>>> fields to be modified.
>>>>>
>>>>> Datastore extends AbstractTableModel because I was initially
>>>>> intending to use a JTable to display and manipulate its contents,
>>>>> but now its successfully manipulating the ragged array I'm having
>>>>> twinges of doubt about how whether a JTable can is the best way of
>>>>> displaying it and allowing it to be viewed and modified, i.e. can a
>>>>> JTable deal successfully with the missing elements at the end of
>>>>> rows in a ragged array?
>>>>>
>>>>> Would I be better off with a custom built structure containing, say,
>>>>> an array of JButtons to display fields in the ragged array and that
>>>>> can be clicked to add a field, edit or delete it?
>>>>>
>>>>> I'll be very interested to hear how you've handled, or would handle,
>>>>> this display problem.
>>>>
>>>> XML/XLST to a web browser.
>>>
>>> ...and modifying it? Saving the result?
>>
>> web app, client side javascript (jquery, handlebars etc...)
>>
>> https://en.wikipedia.org/wiki/Ajax_(programming)
>>
>> or good old CGI html forms processing (POST/GET etc...)
>>
>> or a NodeJS server....
>
> Why would I ever build a web app or use that typeless mess called
> javascript when what I need is a standalone application, preferably
> written in Java (or C with curses or GTK2 at a pinch) that reads, alters
> and saves local files?

when you want multiple people to be able to access & manipulate data on a
central server & you don't want then tied to particular hardware or
software

a well conceived web app would be accessible from any device including an
old WAP mobile phone with minimal disruption to the user experience.

this is not the correct model for every app


--
Wasn't there something about a PASCAL programmer knowing the value of
everything and the Wirth of nothing?

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.